cvs: php4 /ext/standard basic_functions.c
| From: | Sean Bright | Date: | Wed, 21 Mar 2001 13:53:39 +0000 |
| Subject: | cvs: php4 /ext/standard basic_functions.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-4743@lists.php.net to get a copy of this message | ||
elixer Wed Mar 21 05:53:39 2001 EDT
Modified files:
/php4/ext/standard basic_functions.c
Log:
Fix for bug #9698.
# Anyone that can think of a way to fix long2ip(), feel free.
Index: php4/ext/standard/basic_functions.c
diff -u php4/ext/standard/basic_functions.c:1.318 php4/ext/standard/basic_functions.c:1.319
--- php4/ext/standard/basic_functions.c:1.318 Mon Mar 19 13:20:02 2001
+++ php4/ext/standard/basic_functions.c Wed Mar 21 05:53:38 2001
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.c,v 1.318 2001/03/19 21:20:02 andrei Exp $ */
+/* $Id: basic_functions.c,v 1.319 2001/03/21 13:53:38 elixer Exp $ */
#include "php.h"
#include "php_main.h"
@@ -924,6 +924,7 @@
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 @@
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);
}
/* }}} */