]> granicus.if.org Git - php/commitdiff
Patch from Matt W to fix the case of hitting ERANGE too early.
authorAndrei Zmievski <andrei@php.net>
Fri, 6 Oct 2006 17:23:05 +0000 (17:23 +0000)
committerAndrei Zmievski <andrei@php.net>
Fri, 6 Oct 2006 17:23:05 +0000 (17:23 +0000)
Zend/zend_strtol.c

index 7f3855fd44d788be26896b1fa194369e97cd230d..b34be0be7242ad29eacf90aed4de3f852dbde761 100644 (file)
@@ -103,7 +103,7 @@ zend_u_strtol(nptr, endptr, base)
        for (acc = 0, any = 0;; c = *s++) {
                if ((val = u_digit(c, base)) < 0)
                        break;
-               if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
+               if (any < 0 || acc > cutoff || (acc == cutoff && val > cutlim))
                        any = -1;
                else {
                        any = 1;