From: Sascha Schumann Date: Wed, 17 May 2000 16:08:42 +0000 (+0000) Subject: Fix 64-bit issue in gethostbyaddr(). X-Git-Tag: php-4.0.0~73 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f0ed744125099b03b2997a263d412d8be6758a2e;p=php Fix 64-bit issue in gethostbyaddr(). --- diff --git a/ext/standard/dns.c b/ext/standard/dns.c index 65ee1db015..ad676d702a 100644 --- a/ext/standard/dns.c +++ b/ext/standard/dns.c @@ -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