summaryrefslogtreecommitdiff
path: root/extra/cvsps/use-INADDR_NONE-define.patch
blob: a1a5291875ff3d6674cfc7d681fc27779496d45d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From c498733b4283b3987bdca6949a5e304244b64cfc Mon Sep 17 00:00:00 2001
From: Pavel Roskin <proski@gnu.org>
Date: Tue, 13 Jun 2006 00:32:33 -0400
Subject: [PATCH] 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>
---
 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 @@ 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 */
   }
-- 
1.6.5.GIT