changeset 3:3181de3cc627

Use INADDR_NONE instead of -1 to check inet_addr() result INADDR_NONE is not equal to -1 on 64-bit systems. Signed-off-by: Pavel Roskin <proski@gnu.org> committer: ng0 <ng0@crash.cx>
author Pavel Roskin <proski@gnu.org>
date Thu, 22 Feb 2018 15:51:46 +0000
parents 0ef0361648d6
children 75c1615b83b6
files cbtcommon/tcpsocket.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/cbtcommon/tcpsocket.c	Thu Feb 22 15:51:23 2018 +0000
+++ b/cbtcommon/tcpsocket.c	Thu Feb 22 15:51:46 2018 +0000
@@ -198,7 +198,7 @@
     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 */
   }