From: Art Cancro Date: Wed, 24 Jul 2002 04:14:24 +0000 (+0000) Subject: * Minor code cleanup of last night's changes X-Git-Tag: v7.86~6325 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=2add3d7e0100be263626bf60a9aa16cf77a0782d * Minor code cleanup of last night's changes --- diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 121036fc2..c71e97cb2 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -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 1998-12-03 Nathan Bryant * webserver.c: warning fix + diff --git a/webcit/html2html.c b/webcit/html2html.c index e754587b2..4ac9a8fec 100644 --- a/webcit/html2html.c +++ b/webcit/html2html.c @@ -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; } diff --git a/webcit/static/iconbar.html b/webcit/static/iconbar.html index ed2e17890..92e39e294 100644 --- a/webcit/static/iconbar.html +++ b/webcit/static/iconbar.html @@ -4,7 +4,7 @@ + 
-