From: Sean Bright Date: Wed, 21 Mar 2001 13:53:38 +0000 (+0000) Subject: Fix for bug #9698. X-Git-Tag: php-4.0.6RC1~615 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e2495451656a744bf3599a683629153e2c80e382;p=php Fix for bug #9698. # Anyone that can think of a way to fix long2ip(), feel free. --- diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index bf2142d7e7..573b6d48c7 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -924,6 +924,7 @@ PHP_FUNCTION(constant) PHP_FUNCTION(ip2long) { zval **str; + char tmp_buff[16]; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &str) == FAILURE) { WRONG_PARAM_COUNT; @@ -931,7 +932,9 @@ PHP_FUNCTION(ip2long) convert_to_string_ex(str); - RETURN_LONG(ntohl(inet_addr(Z_STRVAL_PP(str)))); + sprintf(tmp_buff, "%u", ntohl(inet_addr(Z_STRVAL_PP(str)))); + + RETURN_STRING(tmp_buff,1); } /* }}} */