initialize 'tag' - value as valgrind tells us
[citadel.git] / libcitadel / lib / html_to_ascii.c
index faa343710c1c19556b67cabd9be578e65dc38f78..29d0e31c44924568b97f03756c22f7e64845fdab 100644 (file)
@@ -67,6 +67,7 @@ char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth, int do_ci
        int bytes_processed = 0;
        char nl[128];
 
+       tag[0] = '\0';
        strcpy(nl, "\n");
        inptr = inputmsg;
        strcpy(inbuf, "");
@@ -469,6 +470,16 @@ char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth, int do_ci
                                strcpy(&outbuf[i+1], &outbuf[i+7]);
                        }
 
+                       else if (!strncasecmp(&outbuf[i], "’", 7)) {
+                               outbuf[i] = '\'';
+                               strcpy(&outbuf[i+1], &outbuf[i+7]);
+                       }
+
+                       else if (!strncasecmp(&outbuf[i], "–", 7)) {
+                               outbuf[i] = '-';
+                               strcpy(&outbuf[i+1], &outbuf[i+7]);
+                       }
+
                        /* two-digit decimal equivalents */
                        else if (outbuf[i] == '&'       &&
                                 outbuf[i + 1] == '#'   &&
@@ -508,7 +519,7 @@ char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth, int do_ci
                                scanch = 0;
                                sscanf(&outbuf[i+2], "%04d", &scanch);
                                outbuf[i] = scanch;
-                               strcpy(&outbuf[i+1], &outbuf[i+6]);
+                               strcpy(&outbuf[i+1], &outbuf[i+7]);
                        }
 
                }