]> code.citadel.org Git - citadel.git/blobdiff - webcit/html2html.c
* while decoding messages, guess the charset in this sequence:
[citadel.git] / webcit / html2html.c
index 4c3f7b6b28bff93a821bd58ba1c2253a802a91f1..bfa53709cc5ab8994092d9419c85aa0c178518c8 100644 (file)
@@ -241,7 +241,7 @@ void output_html(const char *supplied_charset, int treat_as_wiki, int msgnum, St
           && (strcasecmp(charset, ""))
        ) {
                lprintf(9, "Converting %s to UTF-8\n", charset);
-               ic = ctdl_iconv_open("UTF-8", charset);
+               ctdl_iconv_open("UTF-8", charset, &ic);
                if (ic == (iconv_t)(-1) ) {
                        lprintf(5, "%s:%d iconv_open() failed: %s\n",
                                __FILE__, __LINE__, strerror(errno));
@@ -462,7 +462,7 @@ BAIL:       /** A little trailing vertical whitespace... */
 
        /** Now give back the memory */
        FreeStrBuf(&converted_msg);
-       if (msg != NULL) free(msg);
+       if ((msg != NULL) && (Source == NULL)) free(msg);
 }
 
 /*@}*/