]> granicus.if.org Git - php/commitdiff
Fix 64-bit issue in gethostbyaddr().
authorSascha Schumann <sas@php.net>
Wed, 17 May 2000 16:08:42 +0000 (16:08 +0000)
committerSascha Schumann <sas@php.net>
Wed, 17 May 2000 16:08:42 +0000 (16:08 +0000)
ext/standard/dns.c

index 65ee1db015cdc21a0db3d38bbd6d744f4a3a9e6c..ad676d702a020048ba753122506781bac3f7b489 100644 (file)
@@ -71,10 +71,11 @@ PHP_FUNCTION(gethostbyaddr)
 
 char *php_gethostbyaddr(char *ip)
 {
-       unsigned long addr;
+       struct in_addr addr;
        struct hostent *hp;
 
-       if ((int) (addr = inet_addr(ip)) == -1) {
+       addr.s_addr = inet_addr(ip);
+       if (addr.s_addr == -1) {
 #if PHP_DEBUG
                php_error(E_WARNING, "address not in a.b.c.d form");
 #endif