From: ben Date: Fri, 14 Jan 2005 19:28:18 +0000 (+0000) Subject: INADDR_NONE is nonstandard. Use (in_addr_t)(-1) instead. X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/commitdiff_plain/72e2207991a533661d8096d9d46b3fc8465a34ec INADDR_NONE is nonstandard. Use (in_addr_t)(-1) instead. git-svn-id: svn://svn.tartarus.org/sgt/putty@5109 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/unix/uxnet.c b/unix/uxnet.c index d51d75f0..08942215 100644 --- a/unix/uxnet.c +++ b/unix/uxnet.c @@ -166,7 +166,7 @@ SockAddr sk_namelookup(const char *host, char **canonicalname, int address_famil else strncat(realhost, host, sizeof(realhost) - 1); #else - if ((a = inet_addr(host)) == (unsigned long) INADDR_NONE) { + if ((a = inet_addr(host)) == (unsigned long)(in_addr_t)(-1)) { /* * Otherwise use the IPv4-only gethostbyname... (NOTE: * we don't use gethostbyname as a fallback!) @@ -678,7 +678,7 @@ Socket sk_newlistener(char *srcaddr, int port, Plug plug, int local_host_only, i */ if (srcaddr) { a.sin_addr.s_addr = inet_addr(srcaddr); - if (a.sin_addr.s_addr != INADDR_NONE) { + if (a.sin_addr.s_addr != (in_addr_t)(-1)) { /* Override localhost_only with specified listen addr. */ ret->localhost_only = ipv4_is_loopback(a.sin_addr); got_addr = 1;