aboutsummaryrefslogtreecommitdiff
path: root/libsylph/recv.c
diff options
context:
space:
mode:
Diffstat (limited to 'libsylph/recv.c')
-rw-r--r--libsylph/recv.c3
1 files changed, 2 insertions, 1 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;