]> git.sur5r.net Git - openldap/commitdiff
inet_addr cleanup
authorKurt Zeilenga <kurt@openldap.org>
Fri, 31 Dec 2004 12:02:23 +0000 (12:02 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Fri, 31 Dec 2004 12:02:23 +0000 (12:02 +0000)
libraries/libldap/os-ip.c

index dfa3c65650c3148eb90a8b8c89812ba4e1f564c0..5aead880196bdafaebb38db65ad951ba15f30644 100644 (file)
@@ -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