fix various incidents reported by CLANG Static analyzer:
[citadel.git] / webcit / netconf.c
index cdd265a412da3f5e96c2a9b7a722f4928fa4eccc..d08c42db3d60563fd56c50b6035c7a72be2e116f 100644 (file)
@@ -97,8 +97,8 @@ HashList *load_netconf(StrBuf *Target, WCTemplputParams *TP)
                Hash = NewHash(1, NULL);
 
                Buf = NewStrBuf();
-               while ((len = StrBuf_ServGetln(Buf),
-                       strcmp(ChrPtr(Buf), "000"))) {
+               while ((len = StrBuf_ServGetln(Buf), (len >= 0) && 
+                       ((len != 3) || !strcmp(ChrPtr(Buf), "000")))) {
                        Node = NewNode(Buf);
                        if (Node == NULL)
                                continue;