Use INADDR_NONE instead of -1 to check inet_addr() result
authorPavel Roskin <proski@gnu.org>
Tue, 13 Jun 2006 04:32:33 +0000 (13 00:32 -0400)
committerYann Dirson <ydirson@altern.org>
Tue, 13 Jun 2006 07:41:26 +0000 (13 09:41 +0200)
INADDR_NONE is not equal to -1 on 64-bit systems.

Signed-off-by: Pavel Roskin <proski@gnu.org>
cbtcommon/tcpsocket.c

index a174007..f31060e 100644 (file)
@@ -198,7 +198,7 @@ convert_address(long *dest, const char *addr_str)
     memcpy(dest, &ip.s_addr, sizeof(ip.s_addr));
   }
 #else
-  if ( (*dest = inet_addr(addr_str)) != -1)
+  if ( (*dest = inet_addr(addr_str)) != INADDR_NONE)
   {
     /* nothing */
   }