From: Andrei Zmievski Date: Fri, 6 Oct 2006 17:23:05 +0000 (+0000) Subject: Patch from Matt W to fix the case of hitting ERANGE too early. X-Git-Tag: RELEASE_1_0_0RC1~1389 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f47955c66f4d1369dd93e20e4647a4b7007491a3;p=php Patch from Matt W to fix the case of hitting ERANGE too early. --- diff --git a/Zend/zend_strtol.c b/Zend/zend_strtol.c index 7f3855fd44..b34be0be72 100644 --- a/Zend/zend_strtol.c +++ b/Zend/zend_strtol.c @@ -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;