if StrBuf_ServGetln() is called in a loop, its return value has to be checked for...
[citadel.git] / webcit / who.c
index 692481e382dfec128f8850925dc73c0776dc9e27..8904325878763a5c5073e5a1431da1f83601b992 100644 (file)
@@ -51,7 +51,10 @@ int GetWholistSection(HashList *List, time_t now, StrBuf *Buf)
        serv_puts("RWHO");
        StrBuf_ServGetln(Buf);
        if (GetServerStatus(Buf, NULL) == 1) {
-               while (BufLen = StrBuf_ServGetln(Buf), strcmp(ChrPtr(Buf), "000")) {
+               while (BufLen = StrBuf_ServGetln(Buf), 
+                      ((BufLen >= 0) && 
+                       ((BufLen != 3) || strcmp(ChrPtr(Buf), "000"))))
+               {
                        if (BufLen <= 0)
                            continue;
                        Pos = NULL;