Commit 2e58dde3 2e58dde3af88615b3af67dcbae69aaaf5b120783 by Sergey Poznyakoff

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.
1 parent 8355901b
......@@ -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;
......
......@@ -271,7 +271,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)
......