* Minor code cleanup of last night's changes
authorArt Cancro <ajc@citadel.org>
Wed, 24 Jul 2002 04:14:24 +0000 (04:14 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 24 Jul 2002 04:14:24 +0000 (04:14 +0000)
webcit/ChangeLog
webcit/html2html.c
webcit/static/iconbar.html

index 121036fc2da74afd80150b8f3f45ed1deadf54bb..c71e97cb2282474ae55db4014b83b100ad63846b 100644 (file)
@@ -1,4 +1,7 @@
 $Log$
+Revision 323.51  2002/07/24 04:14:23  ajc
+* Minor code cleanup of last night's changes
+
 Revision 323.50  2002/07/23 15:40:54  ajc
 * Minor cleanup of previous changes
 
@@ -875,3 +878,4 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
+
index e754587b2b96148f8b79f61b84443f79400c0bdd..4ac9a8fec9ecc9afc0ae9639dabd836c734e6b03 100644 (file)
@@ -47,21 +47,23 @@ void output_html(void) {
        while (serv_gets(buf), strcmp(buf, "000")) {
                line_length = strlen(buf);
                total_length = total_length + line_length + 1;
-               msg = realloc(msg, total_length);
+               msg = realloc(msg, total_length + 1);
                strcpy(msgend, buf);
-               strcat(msgend, "\n");
-               msgend = &msgend[line_length + 1];
+               msgend[line_length++] = '\n' ;
+               msgend[line_length] = 0;
+               msgend = &msgend[line_length];
        }
 
        ptr = msg;
        msgstart = msg;
-       msgend = &msg[total_length];
+       /* msgend is already set correctly */
 
        while (ptr < msgend) {
 
                /* Advance to next tag */
                ptr = strchr(ptr, '<');
                ++ptr;
+               if ((ptr == NULL) || (ptr >= msgend)) break;
 
                /* Any of these tags cause everything up to and including
                 * the tag to be removed.
@@ -71,7 +73,9 @@ void output_html(void) {
                   ||(!strncasecmp(ptr, "/HEAD", 5))
                   ||(!strncasecmp(ptr, "BODY", 4)) ) {
                        ptr = strchr(ptr, '>');
+                       if ((ptr == NULL) || (ptr >= msgend)) break;
                        ++ptr;
+                       if ((ptr == NULL) || (ptr >= msgend)) break;
                        msgstart = ptr;
                }
 
index ed2e17890d7d91dbb30824c3fc61282b9029471e..92e39e294ae3b8edfac6f759f8da8d1d9cca9423 100644 (file)
@@ -4,7 +4,7 @@
 <TABLE BORDER=0 CELLSPACING=3 CELLPADDING=3>
 
 <TR><TD>
-<IMG BORDER=0 WIDTH=64 HEIGHT=64 SRC="/image&name=hello"></TD></TR>
+<IMG BORDER=0 WIDTH=64 HEIGHT=64 SRC="/image&name=hello" ALT="&nbsp;"></TD></TR>
 
 <TR><TD ALIGN=CENTER
  onMouseOver="this.style.background='#FFFFFF'"