]> code.citadel.org Git - citadel.git/blobdiff - citadel/html.c
fix all the <time.h> vs. <sys/time.h> issues, hopefully
[citadel.git] / citadel / html.c
index a4d67929511cc14c55f23d2d13e44f8d686ec165..29ee1a8ed51f33f079eb51ed2c74588efedabe9b 100644 (file)
@@ -1,6 +1,7 @@
 /*
- * html.c -- Functions which handle translation between HTML and plain text
  * $Id$
+ *
+ * Functions which handle translation between HTML and plain text
  */
 
 #include "sysdep.h"
@@ -9,7 +10,18 @@
 #include <stdio.h>
 #include <fcntl.h>
 #include <signal.h>
-#include <time.h>
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+#  include <sys/time.h>
+# else
+#  include <time.h>
+# endif
+#endif
+
 #include <ctype.h>
 #include <string.h>
 #include <errno.h>
@@ -35,8 +47,8 @@
  * do_citaformat = set to 1 to indent newlines with spaces
  */
 char *html_to_ascii(char *inputmsg, int screenwidth, int do_citaformat) {
-       char inbuf[256];
-       char outbuf[256];
+       char inbuf[SIZ];
+       char outbuf[SIZ];
        char tag[1024];
        int done_reading = 0;
        char *inptr;
@@ -49,7 +61,7 @@ char *html_to_ascii(char *inputmsg, int screenwidth, int do_citaformat) {
        strcpy(inbuf, "");
        strcpy(outbuf, "");
 
-       outptr = mallok(strlen(inptr) + 256);
+       outptr = mallok(strlen(inptr) + SIZ);
        if (outptr == NULL) return NULL;
        strcpy(outptr, "");
        outlen = 0;
@@ -58,7 +70,6 @@ char *html_to_ascii(char *inputmsg, int screenwidth, int do_citaformat) {
                /* Fill the input buffer */
                if ( (done_reading == 0) && (strlen(inbuf) < 128) ) {
 
-                       /* FIX ... genericize this */
                        ch = *inputmsg++;
                        if (ch > 0) {
                                inbuf[strlen(inbuf)+1] = 0;