mirror of
https://github.com/php/php-src.git
synced 2024-11-25 02:44:58 +08:00
@- Fixed long2ip() to return the correct IP address. (Evan)
# ip2long() is still broken.
This commit is contained in:
parent
d191777b3f
commit
d6c66f3b7c
@ -760,8 +760,8 @@ PHP_FUNCTION(long2ip)
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_long_ex(num);
|
||||
myaddr.s_addr = (*num)->value.lval;
|
||||
convert_to_string_ex(num);
|
||||
myaddr.s_addr = strtoul((*num)->value.str.val,NULL,10);
|
||||
|
||||
RETURN_STRING (inet_ntoa(myaddr), 1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user