From 382308f44a4ab93659f9f54c8dac2c2cc381a471 Mon Sep 17 00:00:00 2001 From: Bertrand Guiheneuf Date: Tue, 3 Aug 1999 13:16:35 +0000 Subject: There is a probleme here. We can not allow mime part content-type field * camel/camel-mime-part.c (_set_content_object): There is a probleme here. We can not allow mime part content-type field and content_object mime-type to be different. I thus chosed to set mime part object content field to be freed (if necessary) and set to be a pointer to content_object mime type field. (_construct_from_stream): set content_object mime type to be the same as mime_part's one. This is necessary because we use _set_content_type. This two things are a bit hackish ansd may need to be redesigned. svn path=/trunk/; revision=1071 --- camel/gmime-utils.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'camel/gmime-utils.c') diff --git a/camel/gmime-utils.c b/camel/gmime-utils.c index 7698d01039..24986d48a3 100644 --- a/camel/gmime-utils.c +++ b/camel/gmime-utils.c @@ -32,18 +32,14 @@ gmime_write_header_pair_to_stream (CamelStream *stream, const gchar* name, const { gchar *strtmp; - guint len; + CAMEL_LOG_FULL_DEBUG ( "gmime_write_header_pair_to_stream:: Entering\n"); g_assert(name); -#warning use g_strdup_printf instead - - if (!value) return; - len = strlen (name) + strlen (value) +4; - /* 4 is for ": " and "\n\0" */ - strtmp = g_new (gchar, len); - sprintf (strtmp, "%s: %s\n", name, value); + + if (!value) return; + strtmp = g_strdup_printf ("%s: %s\n", name, value); - camel_stream_write (stream, strtmp, len); + camel_stream_write_string (stream, strtmp); CAMEL_LOG_FULL_DEBUG ( "gmime_write_header_pair_to_stream:\n writing %s\n", strtmp); g_free (strtmp); -- cgit v1.2.3