- negcache.c: better to test for x <= 0 instead of x == 0 when checking the return...
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>
Fri, 26 Dec 2014 21:16:04 +0000 (21:16 +0000)
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>
Fri, 26 Dec 2014 21:16:04 +0000 (21:16 +0000)
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/hopm/branches/1.0.x@5178 82007160-df01-0410-b94d-b575c5fd34c7

src/negcache.c

index 889266c60c08e39d1ea5a48f2c51b76d1db59a39..355e4f0ee1443cb1c5fae35b9c08131c2bfba17d 100644 (file)
@@ -210,7 +210,7 @@ void negcache_insert(const char *ipstr)
    struct bopm_sockaddr ip;
    struct cnode *n;
 
-   if (!inet_pton(AF_INET, ipstr, &(ip.sa4.sin_addr)))
+   if (inet_pton(AF_INET, ipstr, &(ip.sa4.sin_addr)) <= 0)
    {
       log_printf("NEGCACHE -> Invalid IPv4 address '%s'", ipstr);
       return;