diff options
-rw-r--r-- | mail/ChangeLog | 6 | ||||
-rw-r--r-- | mail/em-utils.c | 34 |
2 files changed, 23 insertions, 17 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index cdfd4f8ef5..4eb07d0555 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,9 @@ +2004-08-13 Not Zed <NotZed@Ximian.com> + + * em-utils.c (em_utils_message_to_html): don't include the + terminating NUL in the data length. + (em_utils_part_to_html): nor here. + 2004-08-12 Carlos Garnacho Parro <carlosg@gnome.org> * em-utils.c: Optionally use GtkFileChooser if compiled against diff --git a/mail/em-utils.c b/mail/em-utils.c index b46a77646d..6d7d4a2ba6 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -1417,17 +1417,17 @@ em_utils_part_to_html(CamelMimePart *part, ssize_t *len, EMFormat *source) if (source->charset) em_format_set_default_charset((EMFormat *)emfq, source->charset); } - em_format_part((EMFormat *) emfq, (CamelStream *) mem, part); - g_object_unref (emfq); - - camel_stream_write ((CamelStream *) mem, "", 1); - camel_object_unref (mem); - + em_format_part((EMFormat *) emfq, (CamelStream *)mem, part); + g_object_unref(emfq); + + camel_stream_write((CamelStream *) mem, "", 1); + camel_object_unref(mem); + text = buf->data; if (len) - *len = buf->len; + *len = buf->len-1; g_byte_array_free (buf, FALSE); - + return text; } @@ -1450,24 +1450,24 @@ em_utils_message_to_html(CamelMimeMessage *message, const char *credits, guint32 CamelStreamMem *mem; GByteArray *buf; char *text; - + buf = g_byte_array_new (); mem = (CamelStreamMem *) camel_stream_mem_new (); camel_stream_mem_set_byte_array (mem, buf); - + emfq = em_format_quote_new(credits, (CamelStream *)mem, flags); em_format_set_session((EMFormat *)emfq, session); em_format_format_clone((EMFormat *)emfq, NULL, NULL, message, source); g_object_unref (emfq); - - camel_stream_write ((CamelStream *) mem, "", 1); - camel_object_unref (mem); - + + camel_stream_write((CamelStream *)mem, "", 1); + camel_object_unref(mem); + text = buf->data; if (len) - *len = buf->len; - g_byte_array_free (buf, FALSE); - + *len = buf->len-1; + g_byte_array_free(buf, FALSE); + return text; } |