(rfc2047_encode): Bugfix.
Showing
1 changed file
with
7 additions
and
4 deletions
... | @@ -264,13 +264,16 @@ rfc2047_encode (const char *charset, const char *encoding, | ... | @@ -264,13 +264,16 @@ rfc2047_encode (const char *charset, const char *encoding, |
264 | *result = malloc (2 + strlen (charset) + 3 + strlen (text) * 3 + 3); | 264 | *result = malloc (2 + strlen (charset) + 3 + strlen (text) * 3 + 3); |
265 | if (*result) | 265 | if (*result) |
266 | { | 266 | { |
267 | sprintf (*result, "=?%s?%s?", charset, encoding); | 267 | char *p = *result; |
268 | size_t s; | ||
269 | |||
270 | p += sprintf (p, "=?%s?%s?", charset, encoding); | ||
268 | 271 | ||
269 | rc = stream_sequential_read (output_stream, | 272 | rc = stream_sequential_read (output_stream, |
270 | *result + strlen (*result), | 273 | p, |
271 | strlen (text) * 3, NULL); | 274 | strlen (text) * 3, &s); |
272 | 275 | ||
273 | strcat (*result, "?="); | 276 | strcpy (p + s, "?="); |
274 | } | 277 | } |
275 | else | 278 | else |
276 | rc = ENOMEM; | 279 | rc = ENOMEM; | ... | ... |
-
Please register or sign in to post a comment