diff options
author | Not Zed <NotZed@Ximian.com> | 2004-08-16 11:31:21 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-08-16 11:31:21 +0800 |
commit | 6b9af3bc4616208e7ff06a6d755618057130129f (patch) | |
tree | f9f37c5910f0789836beeed81dc5342d95903842 | |
parent | 77500f5de086e534ad1966d9e1620438ed73c8c7 (diff) | |
download | gsoc2013-evolution-6b9af3bc4616208e7ff06a6d755618057130129f.tar gsoc2013-evolution-6b9af3bc4616208e7ff06a6d755618057130129f.tar.gz gsoc2013-evolution-6b9af3bc4616208e7ff06a6d755618057130129f.tar.bz2 gsoc2013-evolution-6b9af3bc4616208e7ff06a6d755618057130129f.tar.lz gsoc2013-evolution-6b9af3bc4616208e7ff06a6d755618057130129f.tar.xz gsoc2013-evolution-6b9af3bc4616208e7ff06a6d755618057130129f.tar.zst gsoc2013-evolution-6b9af3bc4616208e7ff06a6d755618057130129f.zip |
don't include the terminating NUL in the data length.
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.
svn path=/trunk/; revision=26942
-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; } |