From 83b1ce98318e193931ff15fe6ba92f6044b54ab3 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Fri, 31 Dec 2004 12:02:23 +0000 Subject: [PATCH] inet_addr cleanup --- libraries/libldap/os-ip.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/libraries/libldap/os-ip.c b/libraries/libldap/os-ip.c index dfa3c65650..5aead88019 100644 --- a/libraries/libldap/os-ip.c +++ b/libraries/libldap/os-ip.c @@ -349,11 +349,14 @@ int ldap_pvt_inet_aton( const char *host, struct in_addr *in) { unsigned long u = inet_addr( host ); - if ( u != 0xffffffff || u != (unsigned long) -1 ) { - in->s_addr = u; - return 1; - } - return 0; + +#ifdef INADDR_NONE + if ( u == INADDR_NONE ) return 0; +#endif + if ( u == 0xffffffffUL || u == (unsigned long) -1L ) return 0; + + in->s_addr = u; + return 1; } #endif -- 2.39.5