$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
1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
* webserver.c: warning fix
+
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.
||(!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;
}
<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=" "></TD></TR>
<TR><TD ALIGN=CENTER
onMouseOver="this.style.background='#FFFFFF'"