Re: cvs: php-src(PHP_5_2) /ext/standard basic_functions.c /ext/standard/tests/network ip.phpt
| From: | Jani Taskinen | Date: | Thu, 16 Aug 2007 23:07:03 +0000 |
| Subject: | Re: cvs: php-src(PHP_5_2) /ext/standard basic_functions.c /ext/standard/tests/network ip.phpt | ||
| References: | 1 2 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-45910@lists.php.net to get a copy of this message | ||
Ah, I missed that part from HEAD. :)
Fixed. (although it didn't matter, worked just fine..)
--Jani
Antony Dovgal kirjoitti:
On 17.08.2007 02:17, Jani Taskinen wrote:Are you sure it is correct to compare first 15 bytes of _empty string_ with "255.255.255.255"? I'd say it should look like this: if (Z_STRLEN_PP(str) == (sizeof("255.255.255.255") - 1) && !memcmp(Z_STRVAL_PP(str), "255.255.255.255", Z_STRLEN_PP(str))) {- if (!memcmp(Z_STRVAL_PP(str), "255.255.255.255", Z_STRLEN_PP(str))) { + if (!memcmp(Z_STRVAL_PP(str), "255.255.255.255", sizeof("255.255.255.255") - 1)) { RETURN_LONG(-1); }