From 54602578633b24e84b0caf5be588cdeda8a3bd5c Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Sat, 28 Aug 2010 16:58:08 +0300 Subject: Fix encode2047 test. * mailbox/base64.c (_base64_encoder): Fix the use of uninitialized variable. * mailbox/rfc2047.c (mu_rfc2047_encode): Rewind the input stream before reading from it. --- mailbox/base64.c | 2 +- mailbox/rfc2047.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mailbox/base64.c b/mailbox/base64.c index f70a40baa..8ceba2699 100644 --- a/mailbox/base64.c +++ b/mailbox/base64.c @@ -197,7 +197,7 @@ _base64_encoder (void *xd MU_ARG_UNUSED, break; } - if (isize <= 3) + if (iobuf->isize <= 3) { if (cmd == mu_filter_lastbuf) pad = 1; diff --git a/mailbox/rfc2047.c b/mailbox/rfc2047.c index df19d9fe8..06d94c295 100644 --- a/mailbox/rfc2047.c +++ b/mailbox/rfc2047.c @@ -267,7 +267,7 @@ mu_rfc2047_encode (const char *charset, const char *encoding, return rc; mu_stream_write (input_stream, text, strlen (text), NULL); - + mu_stream_seek (input_stream, 0, MU_SEEK_SET, NULL); rc = mu_filter_create (&output_stream, input_stream, encoding, MU_FILTER_ENCODE, MU_STREAM_READ); if (rc == 0) -- cgit v1.2.1