]> granicus.if.org Git - php/commitdiff
- MFH: Add a comment why not ~0 or -1.
authorDerick Rethans <derick@php.net>
Thu, 6 Sep 2007 13:28:05 +0000 (13:28 +0000)
committerDerick Rethans <derick@php.net>
Thu, 6 Sep 2007 13:28:05 +0000 (13:28 +0000)
ext/standard/basic_functions.c

index 5014f9fcb2945167a08ee6d81196ff2144b26a89..a063bfab1f7b3330566edd8e4bc3f349f1251589 100644 (file)
@@ -4336,7 +4336,8 @@ PHP_FUNCTION(ip2long)
 
        if (Z_STRLEN_PP(str) == 0 || (ip = inet_addr(Z_STRVAL_PP(str))) == INADDR_NONE) {
                /* the only special case when we should return -1 ourselves,
-                * because inet_addr() considers it wrong.
+                * because inet_addr() considers it wrong. We return 0xFFFFFFFF and
+                * not -1 or ~0 because of 32/64bit issues.
                 */
                if (Z_STRLEN_PP(str) == sizeof("255.255.255.255") - 1 &&
                        !memcmp(Z_STRVAL_PP(str), "255.255.255.255", sizeof("255.255.255.255") - 1)) {