From bf89d5c1808dec9e543b0a713bdb80d35d2e2ad2 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Sat, 23 Jul 2016 00:12:46 +0200 Subject: [PATCH] mshow: render_mime: set a default mime type --- mshow.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mshow.c b/mshow.c index 3684faf..2016db7 100644 --- a/mshow.c +++ b/mshow.c @@ -146,6 +146,8 @@ mime_action render_mime(int depth, struct message *msg, char *body, size_t bodylen) { char *ct = blaze822_hdr(msg, "content-type"); + if (!ct) + ct = "text/x-unknown"; char *mt = mimetype(ct); char *tlmt = tlmimetype(ct); char *filename = mime_filename(msg); @@ -230,7 +232,7 @@ reply_mime(int depth, struct message *msg, char *body, size_t bodylen) { (void) depth; - char *ct = blaze822_hdr(msg, "Content-Type"); + char *ct = blaze822_hdr(msg, "content-type"); char *mt = mimetype(ct); char *tlmt = tlmimetype(ct); @@ -260,6 +262,8 @@ list_mime(int depth, struct message *msg, char *body, size_t bodylen) (void) body; char *ct = blaze822_hdr(msg, "content-type"); + if (!ct) + ct = "text/x-unknown"; char *mt = mimetype(ct); char *filename = mime_filename(msg);