From: Zeev Suraski Date: Sat, 26 Feb 2000 04:07:03 +0000 (+0000) Subject: Fix comparisons of "inf"=="inf" and "-inf"=="-inf" X-Git-Tag: PHP-4.0-RC1~403 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=80782eff1f1612301ce1d8bcb2b5fd7ca4051d0b;p=php Fix comparisons of "inf"=="inf" and "-inf"=="-inf" @- Comparing the string "inf" with "inf" returned false - fixed (Zeev) --- diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index a023a69ee6..e87c4dc6e0 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "zend.h" #include "zend_operators.h" @@ -1361,6 +1362,11 @@ ZEND_API inline int is_numeric_string(char *str, int length, long *lval, double errno=0; local_dval = strtod(str, &end_ptr); if (errno!=ERANGE && end_ptr == str+length) { /* floating point string */ + if (local_dval==HUGE_VAL || local_dval==-HUGE_VAL) { + /* "inf" */ + return 0; + } + if (dval) { *dval = local_dval; }