dovecot-2.0: istream-base64-encoder: Don't add unwanted trailing...

dovecot at dovecot.org dovecot at dovecot.org
Mon Nov 15 18:22:15 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/3f19e7e43506
changeset: 12418:3f19e7e43506
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Nov 15 16:06:58 2010 +0000
description:
istream-base64-encoder: Don't add unwanted trailing [CR]LF

diffstat:

 src/lib/istream-base64-encoder.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (24 lines):

diff -r 967de059f94d -r 3f19e7e43506 src/lib/istream-base64-encoder.c
--- a/src/lib/istream-base64-encoder.c	Mon Nov 15 15:42:21 2010 +0000
+++ b/src/lib/istream-base64-encoder.c	Mon Nov 15 16:06:58 2010 +0000
@@ -46,6 +46,10 @@
 	size_t size, buffer_avail;
 	buffer_t buf;
 
+	data = i_stream_get_data(stream->parent, &size);
+	if (size == 0)
+		return FALSE;
+
 	if (bstream->cur_line_len == bstream->chars_per_line) {
 		/* @UNSAFE: end of line, add newline */
 		if (!i_stream_get_buffer_space(stream,
@@ -57,9 +61,6 @@
 		stream->w_buffer[stream->pos++] = '\n';
 		bstream->cur_line_len = 0;
 	}
-	data = i_stream_get_data(stream->parent, &size);
-	if (size == 0)
-		return FALSE;
 
 	i_stream_get_buffer_space(stream, (size+2)/3*4, NULL);
 	buffer_avail = stream->buffer_size - stream->pos;


More information about the dovecot-cvs mailing list