tony2001 Thu Aug 19 11:14:05 2004 EDT
Modified files:
/php-src/ext/standard basic_functions.c
Log:
fix #29737 in the right way with performance in mind
http://cvs.php.net/diff.php/php-src/ext/standard/basic_functions.c?r1=1.684&r2=1.685&ty=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.684
php-src/ext/standard/basic_functions.c:1.685
--- php-src/ext/standard/basic_functions.c:1.684 Thu Aug 19 09:59:29 2004
+++ php-src/ext/standard/basic_functions.c Thu Aug 19 11:14:04 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.c,v 1.684 2004/08/19 13:59:29 tony2001 Exp $ */
+/* $Id: basic_functions.c,v 1.685 2004/08/19 15:14:04 tony2001 Exp $ */
#include "php.h"
#include "php_streams.h"
@@ -1365,14 +1365,14 @@
convert_to_string_ex(str);
- /* the only special case when we should return -1 ourselves,
- * because inet_addr() considers it wrong.
- */
- if (!strcasecmp(Z_STRVAL_PP(str), "255.255.255.255")) {
- RETURN_LONG(-1);
- }
-
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.
+ */
+ if (!memcmp(Z_STRVAL_PP(str), "255.255.255.255", Z_STRLEN_PP(str))) {
+ RETURN_LONG(-1);
+ }
+
RETURN_FALSE;
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php