aboutsummaryrefslogtreecommitdiff
path: root/libsylph
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-04-18 06:02:24 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-04-18 06:02:24 +0000
commitf63f43aeaa8a95baed64386e9992e8eecf3bdbb1 (patch)
treec556e742b2e5dc8018bd2ea6efa577f8fe37e0af /libsylph
parentd9e42f0b6958e51d19600fd501e90c5b587aace9 (diff)
fixed crashes when trying to fetch >64KB messages on IMAP4 via FreeCap on Win32.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1647 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph')
-rw-r--r--libsylph/recv.c3
-rw-r--r--libsylph/utils.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/libsylph/recv.c b/libsylph/recv.c
index 47222709..d813eba7 100644
--- a/libsylph/recv.c
+++ b/libsylph/recv.c
@@ -50,7 +50,8 @@ gchar *recv_bytes(SockInfo *sock, glong size)
do {
gint read_count;
- read_count = sock_read(sock, buf + count, size - count);
+ read_count = sock_read(sock, buf + count,
+ MIN(BUFFSIZE, size - count));
if (read_count <= 0) {
g_free(buf);
return NULL;
diff --git a/libsylph/utils.c b/libsylph/utils.c
index ed3ac5d7..1336d954 100644
--- a/libsylph/utils.c
+++ b/libsylph/utils.c
@@ -4139,7 +4139,7 @@ void log_print(const gchar *format, ...)
g_vsnprintf(buf + TIME_LEN, BUFFSIZE, format, args);
va_end(args);
- if (debug_mode) fputs(buf, stdout);
+ if (debug_mode) g_print("%s", buf);
log_print_ui_func(buf);
if (log_fp) {
fputs(buf, log_fp);