]> granicus.if.org Git - php/commitdiff
Modified fix for bug #22187 so that it does not affect handling of numbers
authorIlia Alshanetsky <iliaa@php.net>
Thu, 13 Feb 2003 19:02:34 +0000 (19:02 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 13 Feb 2003 19:02:34 +0000 (19:02 +0000)
represented in scientific notation.

main/snprintf.c

index fa5a07cc45a6a3c43d0a432e9a8dabe4e36c848f..ec8c0d515f84cd882bd247526cea5507e5e4152e 100644 (file)
@@ -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--;
                }