Skip to content

Commit

Permalink
Use INADDR_NONE instead of -1 to check inet_addr() result
Browse files Browse the repository at this point in the history
INADDR_NONE is not equal to -1 on 64-bit systems.

Signed-off-by: Pavel Roskin <proski@gnu.org>
  • Loading branch information
Pavel Roskin authored and ydirson committed Jun 13, 2006
1 parent 4598349 commit c498733
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cbtcommon/tcpsocket.c
Expand Up @@ -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 */
}
Expand Down

0 comments on commit c498733

Please sign in to comment.