aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-remote-store.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-12-22 01:14:07 +0800
committerDan Winship <danw@src.gnome.org>2000-12-22 01:14:07 +0800
commitd812b5e3315cedafbd359b2c4b06c6bcccd951ac (patch)
treef4785ce50943aab10506bfa79902b66f98afc8a2 /camel/camel-remote-store.c
parentd2a8b907f899ac4751b24f15d7c3d99b1756e075 (diff)
downloadgsoc2013-evolution-d812b5e3315cedafbd359b2c4b06c6bcccd951ac.tar.gz
gsoc2013-evolution-d812b5e3315cedafbd359b2c4b06c6bcccd951ac.tar.zst
gsoc2013-evolution-d812b5e3315cedafbd359b2c4b06c6bcccd951ac.zip
Update the doc comment: since it always NUL-terminates the buffer, it
* camel-stream-buffer.c (camel_stream_buffer_gets): Update the doc comment: since it always NUL-terminates the buffer, it reads at most @max-1 bytes, not @max. * camel-remote-store.c (remote_recv_line): Fix the "did camel_stream_buffer_gets fill the whole buffer" check. Fixes a bug when reading lines longer than 1024 characters (eg, IMAP SEARCH responses in very large folders). svn path=/trunk/; revision=7117
Diffstat (limited to 'camel/camel-remote-store.c')
-rw-r--r--camel/camel-remote-store.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/camel/camel-remote-store.c b/camel/camel-remote-store.c
index c69ba3591e..3a64f59ce6 100644
--- a/camel/camel-remote-store.c
+++ b/camel/camel-remote-store.c
@@ -409,7 +409,7 @@ remote_recv_line (CamelRemoteStore *store, char **dest, CamelException *ex)
{
CamelStreamBuffer *stream = CAMEL_STREAM_BUFFER (store->istream);
GByteArray *bytes;
- gchar buf[1025], *ret;
+ gchar buf[1024], *ret;
gint nread;
*dest = NULL;
@@ -434,10 +434,10 @@ remote_recv_line (CamelRemoteStore *store, char **dest, CamelException *ex)
bytes = g_byte_array_new ();
do {
- nread = camel_stream_buffer_gets (stream, buf, 1024);
+ nread = camel_stream_buffer_gets (stream, buf, sizeof (buf));
if (nread > 0)
g_byte_array_append (bytes, buf, nread);
- } while (nread == 1024);
+ } while (nread == sizeof (buf) - 1);
g_byte_array_append (bytes, "", 1);
ret = bytes->data;