diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2005-07-25 22:55:08 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2005-07-25 22:55:08 +0000 |
commit | 4778f425c53181ce5ba2d4f927bd1c15d1e6d134 (patch) | |
tree | 61f7ed62dd3a836b7f6112483eb8752e62377f23 | |
parent | 4defa8ecfe3b2cd98d41a4da5b6ced514a9d285b (diff) | |
download | mailutils-4778f425c53181ce5ba2d4f927bd1c15d1e6d134.tar.gz mailutils-4778f425c53181ce5ba2d4f927bd1c15d1e6d134.tar.bz2 |
(rfc2047_encode): Bugfix.
-rw-r--r-- | mailbox/rfc2047.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/mailbox/rfc2047.c b/mailbox/rfc2047.c index 85eaeeea3..819f4392b 100644 --- a/mailbox/rfc2047.c +++ b/mailbox/rfc2047.c @@ -264,13 +264,16 @@ rfc2047_encode (const char *charset, const char *encoding, *result = malloc (2 + strlen (charset) + 3 + strlen (text) * 3 + 3); if (*result) { - sprintf (*result, "=?%s?%s?", charset, encoding); + char *p = *result; + size_t s; + + p += sprintf (p, "=?%s?%s?", charset, encoding); rc = stream_sequential_read (output_stream, - *result + strlen (*result), - strlen (text) * 3, NULL); + p, + strlen (text) * 3, &s); - strcat (*result, "?="); + strcpy (p + s, "?="); } else rc = ENOMEM; |