diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-07-06 02:02:01 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-09-14 20:08:34 +0800 |
commit | af704b849e6a28582ca6d75b0ee0ef3a867587cf (patch) | |
tree | d8db9243ed23680f0b78ef5b87ecee4df68eb4b8 /plugins/itip-formatter/itip-formatter.c | |
parent | c72aba8f7c13cdc68b1f3dbc1d381be45e0c4cb8 (diff) | |
download | gsoc2013-evolution-af704b849e6a28582ca6d75b0ee0ef3a867587cf.tar gsoc2013-evolution-af704b849e6a28582ca6d75b0ee0ef3a867587cf.tar.gz gsoc2013-evolution-af704b849e6a28582ca6d75b0ee0ef3a867587cf.tar.bz2 gsoc2013-evolution-af704b849e6a28582ca6d75b0ee0ef3a867587cf.tar.lz gsoc2013-evolution-af704b849e6a28582ca6d75b0ee0ef3a867587cf.tar.xz gsoc2013-evolution-af704b849e6a28582ca6d75b0ee0ef3a867587cf.tar.zst gsoc2013-evolution-af704b849e6a28582ca6d75b0ee0ef3a867587cf.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); } |