summaryrefslogtreecommitdiff
path: root/Zend
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2000-02-26 04:07:03 +0000
committerZeev Suraski <zeev@php.net>2000-02-26 04:07:03 +0000
commit80782eff1f1612301ce1d8bcb2b5fd7ca4051d0b (patch)
tree699fdadf20dae4b71b1e0650513fa718b2604d20 /Zend
parent4d7150657c6fb4154beecdfa6308e6bec5810c37 (diff)
downloadphp-git-80782eff1f1612301ce1d8bcb2b5fd7ca4051d0b.tar.gz
Fix comparisons of "inf"=="inf" and "-inf"=="-inf"
@- Comparing the string "inf" with "inf" returned false - fixed (Zeev)
Diffstat (limited to 'Zend')
-rw-r--r--Zend/zend_operators.c6
1 files changed, 6 insertions, 0 deletions
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 <stdlib.h>
#include <limits.h>
#include <ctype.h>
+#include <math.h>
#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;
}