From: Ilia Alshanetsky Date: Thu, 13 Feb 2003 19:02:34 +0000 (+0000) Subject: Modified fix for bug #22187 so that it does not affect handling of numbers X-Git-Tag: RELEASE_0_5~1034 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f9669f6c49d501979cf7f72a8ff97255344d6089;p=php Modified fix for bug #22187 so that it does not affect handling of numbers represented in scientific notation. --- diff --git a/main/snprintf.c b/main/snprintf.c index fa5a07cc45..ec8c0d515f 100644 --- a/main/snprintf.c +++ b/main/snprintf.c @@ -298,7 +298,10 @@ ap_php_cvt(double arg, int ndigits, int *decpt, int *sign, int eflag, char *buf) while (p1 < &buf[NDIG]) *p++ = *p1++; } else if (arg > 0) { - while ((fj = arg * 10) < 1 && (r2 * -1) < ndigits) { + while ((fj = arg * 10) < 1) { + if (!eflag && (r2 * -1) < ndigits) { + break; + } arg = fj; r2--; }