* serv_read() now zeroes out the supplied buffer (with the supplied
authorArt Cancro <ajc@citadel.org>
Sun, 7 Mar 2004 21:31:17 +0000 (21:31 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 7 Mar 2004 21:31:17 +0000 (21:31 +0000)
  length) if a server read fails.  This causes serv_gets() to return
  instead of looping endlessly.  Fixes chat problem found on linux-ppc.

webcit/ChangeLog
webcit/tcp_sockets.c
webcit/userlist.c

index 0ef62ca06bbb2d7718eda6e08b53e22b9eb86d8c..35ff7b36a03850dffd1f2bab4df0acf8037e0953 100644 (file)
@@ -1,4 +1,9 @@
 $Log$
+Revision 505.12  2004/03/07 21:31:17  ajc
+* serv_read() now zeroes out the supplied buffer (with the supplied
+  length) if a server read fails.  This causes serv_gets() to return
+  instead of looping endlessly.  Fixes chat problem found on linux-ppc.
+
 Revision 505.11  2004/03/03 05:21:36  ajc
 * Made the chat screen totally kick-ass sweet.  The flickering reload
   i-frame is now tiny and hidden, and it *appends* new chat data to
@@ -1706,4 +1711,3 @@ 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 b3c853d31f9d2b0b8c709ce302bb64f9c5853ba8..77867fc4a4487afd94b8b55772481aa6e8f57461 100644 (file)
@@ -149,6 +149,7 @@ void serv_read(char *buf, int bytes)
                        WC->serv_sock = (-1);
                        WC->connected = 0;
                        WC->logged_in = 0;
+                       memset(buf, 0, bytes);
                        return;
                }
                len = len + rlen;
index a20028c029766ba6587867c0f41947928ca3a611..d05e635a42f6484d69198b452afb9847359cf303 100644 (file)
@@ -39,6 +39,7 @@ void userlist(void)
        struct namelist *bio = NULL;
        struct namelist *bptr;
        int has_bio;
+       int bg = 0;
 
        serv_puts("LBIO");
        serv_gets(buf);
@@ -63,7 +64,7 @@ void userlist(void)
 
        do_template("beginbox");
        wprintf("<CENTER>");
-       wprintf("<TABLE border>");
+       wprintf("<TABLE border=0 width=100%%>");
        wprintf("<TR><TH>User Name</TH><TH>Number</TH><TH>Access Level</TH>");
        wprintf("<TH>Last Call</TH><TH>Total Calls</TH><TH>Total Posts</TH></TR>\n");
 
@@ -74,7 +75,10 @@ void userlist(void)
                        if (!strcasecmp(fl, bptr->name))
                                has_bio = 1;
                }
-               wprintf("<TR><TD>");
+               bg = 1 - bg;
+               wprintf("<TR BGCOLOR=\"#%s\"><TD>",
+                       (bg ? "DDDDDD" : "FFFFFF")
+               );
                if (has_bio) {
                        wprintf("<A HREF=\"/showuser&who=");
                        urlescputs(fl);