if StrBuf_ServGetln() is called in a loop, its return value has to be checked for...
[citadel.git] / webcit / who.c
index c3df2556dfef80c3fa6824165d09b788c5112531..9fdd9a90b53838f47377cde67ad00a520bee23eb 100644 (file)
@@ -48,7 +48,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;