diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-07-06 02:02:01 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-07-06 02:40:10 +0800 |
commit | 005a26de4534cfaf534e8e4828366b619a3b21d1 (patch) | |
tree | e9247d1dfa10750a07335647cf37f43b158a8817 /plugins/itip-formatter/itip-formatter.c | |
parent | 17127fbee9fd1b0baecb4e305c005d6abbf8d880 (diff) | |
download | gsoc2013-evolution-005a26de4534cfaf534e8e4828366b619a3b21d1.tar.gz gsoc2013-evolution-005a26de4534cfaf534e8e4828366b619a3b21d1.tar.zst gsoc2013-evolution-005a26de4534cfaf534e8e4828366b619a3b21d1.zip |
Avoid camel_stream_printf().
camel_stream_printf() is next on the chopping block.
Use g_strdup_printf() or a GString to construct a formatted string in
memory, pass it to camel_stream_write() in one go, and then check for
errors (unless it's a memory stream).
Diffstat (limited to 'plugins/itip-formatter/itip-formatter.c')
-rw-r--r-- | plugins/itip-formatter/itip-formatter.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index 0770ea2ebb..f5b2bcdcf0 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -2819,6 +2819,7 @@ format_itip (EPlugin *ep, EMFormatHookTarget *target) CamelDataWrapper *content; CamelStream *stream; GByteArray *byte_array; + gchar *string; classid = g_strdup_printf("itip:///%s", ((EMFormat *) target->format)->part_id->str); @@ -2859,9 +2860,13 @@ format_itip (EPlugin *ep, EMFormatHookTarget *target) g_object_unref (stream); - camel_stream_printf (target->stream, "<table border=0 width=\"100%%\" cellpadding=3><tr>"); - camel_stream_printf (target->stream, "<td valign=top><object classid=\"%s\"></object></td><td width=100%% valign=top>", classid); - camel_stream_printf (target->stream, "</td></tr></table>"); + string = g_strdup_printf ( + "<table border=0 width=\"100%%\" cellpadding=3><tr>" + "<td valign=top><object classid=\"%s\"></object></td>" + "<td width=100%% valign=top></td></tr></table>", + classid); + camel_stream_write_string (target->stream, string, NULL, NULL); + g_free (string); g_free (classid); } |