diff options
Diffstat (limited to 'camel')
-rw-r--r-- | camel/ChangeLog | 11 | ||||
-rw-r--r-- | camel/camel-remote-store.c | 6 | ||||
-rw-r--r-- | camel/camel-stream-buffer.c | 2 |
3 files changed, 15 insertions, 4 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index da7caa6cf2..272f058ad4 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,14 @@ +2000-12-21 Dan Winship <danw@helixcode.com> + + * 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). + 2000-12-19 Dan Winship <danw@helixcode.com> * providers/imap/camel-imap-folder.c (imap_refresh_info): Oops. 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; diff --git a/camel/camel-stream-buffer.c b/camel/camel-stream-buffer.c index dd5f0bc287..7df9fa30ee 100644 --- a/camel/camel-stream-buffer.c +++ b/camel/camel-stream-buffer.c @@ -357,7 +357,7 @@ stream_eos (CamelStream *stream) * @max: Maxmimum number of characters to store. * * Read a line of characters up to the next newline character or - * @max characters. + * @max-1 characters. * * If the newline character is encountered, then it will be * included in the buffer @buf. The buffer will be #NUL terminated. |