Negated a strcmp in netconf.c that caused the function to hang every single time...
[citadel.git] / webcit / netconf.c
index 8683879ffc2bbd74873bda4caad4855a7a21d508..a426217114c97cd6dbae6527f88e7f384e9c3ae2 100644 (file)
@@ -88,14 +88,13 @@ HashList *load_netconf(StrBuf *Target, WCTemplputParams *TP)
                Hash = NewHash(1, NULL);
 
                Buf = NewStrBuf();
-               while ((len = StrBuf_ServGetln(Buf),
-                       (len != 3) || !strcmp(ChrPtr(Buf), "000"))) {
+               while (len = StrBuf_ServGetln(Buf), strcmp(ChrPtr(Buf), "000")) {
                        Node = NewNode(Buf);
-                       if (Node == NULL)
-                               continue;
-                       nUsed = GetCount(Hash);
-                       nUsed = snprintf(nnn, sizeof(nnn), "%d", nUsed+1);
-                       Put(Hash, nnn, nUsed, Node, DeleteNodeConf); 
+                       if (Node != NULL) {
+                               nUsed = GetCount(Hash);
+                               nUsed = snprintf(nnn, sizeof(nnn), "%d", nUsed+1);
+                               Put(Hash, nnn, nUsed, Node, DeleteNodeConf); 
+                       }
                }
                FreeStrBuf(&Buf);
                return Hash;