X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fmhparse.c;h=7c1000060dd86ffb4dd11459a0bd382996edcf12;hp=f5ff85c24437cf1a4b86240cc343eab37866f82c;hb=d8916ff5d389de5ab225cd6f40aeda1b285d0f28;hpb=636b3bab53e3fc2154bb86fb02aeecf433cc977a diff --git a/uip/mhparse.c b/uip/mhparse.c index f5ff85c..7c10000 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -1058,7 +1058,7 @@ static int InitText (CT ct) { char buffer[BUFSIZ]; - char *chset; + char *chset = NULL; char **ap, **ep, *cp; struct k2v *kv; struct text *t; @@ -1087,9 +1087,12 @@ InitText (CT ct) /* check if content specified a character set */ if (*ap) { /* match character set or set to CHARSET_UNKNOWN */ - for (kv = Charset; kv->kv_key; kv++) - if (!mh_strcasecmp (*ep, kv->kv_key)) + for (kv = Charset; kv->kv_key; kv++) { + if (!mh_strcasecmp (*ep, kv->kv_key)) { + chset = *ep; break; + } + } t->tx_charset = kv->kv_value; } else { t->tx_charset = CHARSET_UNSPECIFIED;