login
Header Space

 
 

[PATCH 4/4] Use INADDR_NONE instead of -1 to check inet_addr() result

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Yann Dirson <ydirson@...>, <git@...>, <cvsps@...>
Date: Tuesday, June 13, 2006 - 12:32 am

From: Pavel Roskin <proski@gnu.org>

INADDR_NONE is not equal to -1 on 64-bit systems.

Signed-off-by: Pavel Roskin <proski@gnu.org>
---

 cbtcommon/tcpsocket.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cbtcommon/tcpsocket.c b/cbtcommon/tcpsocket.c
index a174007..f31060e 100644
--- a/cbtcommon/tcpsocket.c
+++ b/cbtcommon/tcpsocket.c
@@ -198,7 +198,7 @@ #ifdef __linux__
     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 */
   }

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/4] Remove dependencies with absolute path, Pavel Roskin, (Tue Jun 13, 12:32 am)
[PATCH 4/4] Use INADDR_NONE instead of -1 to check inet_addr..., Pavel Roskin, (Tue Jun 13, 12:32 am)
[PATCH 3/4] Use __linux__ conditional, not LINUX., Pavel Roskin, (Tue Jun 13, 12:32 am)
[PATCH 2/4] Trivial compile fix for cache.c, Pavel Roskin, (Tue Jun 13, 12:32 am)
speck-geostationary