From 4f9326dff42b1001f35e704e4426cee01432bd18 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Sun, 8 Oct 2000 06:56:13 +0000 Subject: Issue a warning if h->value is NULL. 2000-10-08 Miguel de Icaza * camel-mime-part.c (write_to_stream): Issue a warning if h->value is NULL. svn path=/trunk/; revision=5785 --- camel/camel-mime-part.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c index d37b4c2fae..21deb4c5f9 100644 --- a/camel/camel-mime-part.c +++ b/camel/camel-mime-part.c @@ -488,8 +488,16 @@ write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream) if (mp->headers) { struct _header_raw *h = mp->headers; + while (h) { - count = camel_stream_printf(stream, "%s%s%s\n", h->name, isspace(h->value[0]) ? ":" : ": ", h->value); + if (h->value == NULL){ + g_warning ("h->value is NULL here for %s", h->name); + count = 0; + } else { + count = camel_stream_printf( + stream, "%s%s%s\n", h->name, + isspace(h->value[0]) ? ":" : ": ", h->value); + } if (count == -1) return -1; total += count; -- cgit v1.2.3