]> code.citadel.org Git - citadel.git/blobdiff - webcit/html2html.c
* Bumped internal version number to 6.31. Minimum Citadel server required
[citadel.git] / webcit / html2html.c
index 110d9682e31d937ffa35a47ee621b75f860431eb..f41ac542a69977a5b479c5bb3f73902998c44171 100644 (file)
@@ -6,29 +6,6 @@
  *
  */
 
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <sys/socket.h>
-#include <limits.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <string.h>
-#include <pwd.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <pthread.h>
-#include <signal.h>
-
-#ifdef HAVE_ICONV
-#include <iconv.h>
-#endif
-
 #include "webcit.h"
 #include "vcard.h"
 #include "webserver.h"
@@ -71,10 +48,11 @@ void output_html(char *charset) {
                buffer_length = content_length + line_length + 2;
                msg = realloc(msg, buffer_length);
                if (msg == NULL) {
-                       wprintf("<B>realloc() error!  "
-                               "couldn't get %d bytes: %s</B><br /><br />\n",
+                       wprintf("<B>");
+                       wprintf(_("realloc() error! couldn't get %d bytes: %s"),
                                buffer_length + 1,
                                strerror(errno));
+                       wprintf("</B><br /><br />\n");
                        return;
                }
                strcpy(&msg[content_length], buf);
@@ -85,10 +63,13 @@ void output_html(char *charset) {
 
 #ifdef HAVE_ICONV
        if ( (strcasecmp(charset, "us-ascii"))
-          && (strcasecmp(charset, "UTF-8")) ) {
+          && (strcasecmp(charset, "UTF-8"))
+          && (strcasecmp(charset, ""))
+       ) {
                ic = iconv_open("UTF-8", charset);
                if (ic == (iconv_t)(-1) ) {
-                       lprintf(5, "iconv_open() failed: %s\n", strerror(errno));
+                       lprintf(5, "%s:%d iconv_open() failed: %s\n",
+                               __FILE__, __LINE__, strerror(errno));
                }
        }
        if (ic != (iconv_t)(-1) ) {