if StrBuf_ServGetln() is called in a loop, its return value has to be checked for...
[citadel.git] / webcit / roomlist.c
index bb59c953d974211e6109bce7f0597da9f109d4fd..c86a7f78dcf104cfec004830d9a80c8977432943 100644 (file)
@@ -21,7 +21,7 @@ HashList *GetWhoKnowsHash(StrBuf *Target, WCTemplputParams *TP)
        if (GetServerStatus(Line, &State) == 1) 
        {
                Whok = NewHash(1, Flathash);
-               while(!Done && StrBuf_ServGetln(Line))
+               while(!Done && (StrBuf_ServGetln(Line) >= 0) )
                        if ( (StrLength(Line)==3) && 
                             !strcmp(ChrPtr(Line), "000")) 
                        {
@@ -108,7 +108,7 @@ HashList *GetFloorListHash(StrBuf *Target, WCTemplputParams *TP)
        StrBufTCP_read_line(Buf, &WC->serv_sock, 0, &Err); /* '100', we hope */
        if (GetServerStatus(Buf, NULL) == 1) 
        {
-               while(!Done && StrBuf_ServGetln(Buf))
+               while(!Done && StrBuf_ServGetln(Buf) >= 0)
                        if ( (StrLength(Buf)==3) && 
                             !strcmp(ChrPtr(Buf), "000")) 
                        {
@@ -230,7 +230,7 @@ HashList *GetRoomListHash(StrBuf *Target, WCTemplputParams *TP)
        StrBuf_ServGetln(Buf);
        if (GetServerStatus(Buf, NULL) == 1) 
        {
-               while(!Done && StrBuf_ServGetln(Buf))
+               while(!Done && (StrBuf_ServGetln(Buf) >= 0))
                        if ( (StrLength(Buf)==3) && 
                             !strcmp(ChrPtr(Buf), "000")) 
                        {
@@ -341,7 +341,7 @@ HashList *GetNetConfigHash(StrBuf *Target, WCTemplputParams *TP)
                const char *Pos = NULL;
                int Done = 0;
 
-               while(!Done && StrBuf_ServGetln(Line))
+               while(!Done && (StrBuf_ServGetln(Line) >= 0))
                        if ( (StrLength(Line)==3) && 
                             !strcmp(ChrPtr(Line), "000"))
                        {