From 92d54d5413cc630032e81c9680f5e5089c9edbcc Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 7 Sep 2011 15:43:37 -0400 Subject: [PATCH] Negated a strcmp in netconf.c that caused the function to hang every single time, how did this get this way? --- webcit/netconf.c | 13 ++++++------- webcit/tcp_sockets.c | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/webcit/netconf.c b/webcit/netconf.c index 8683879ff..a42621711 100644 --- a/webcit/netconf.c +++ b/webcit/netconf.c @@ -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; diff --git a/webcit/tcp_sockets.c b/webcit/tcp_sockets.c index da483deab..bb4d6015e 100644 --- a/webcit/tcp_sockets.c +++ b/webcit/tcp_sockets.c @@ -18,8 +18,8 @@ /* * Uncomment this to log all communications with the Citadel server -#define SERV_TRACE 1 */ +#define SERV_TRACE 1 #include "webcit.h" -- 2.30.2