summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2008-09-15 11:47:16 +0000
committerDmitry Stogov <dmitry@php.net>2008-09-15 11:47:16 +0000
commit1474d9dfad906b926247677a8ba608d245b8d255 (patch)
treed1836d83b5fafbd04faf6ac916be66ee223d716c /main
parent612c93b78b45995ae34b37de38a42d2f1f29efa3 (diff)
downloadphp-git-1474d9dfad906b926247677a8ba608d245b8d255.tar.gz
Fixed bug #43053 (Regression: some numbers shown in scientific notation). (int-e at gmx dot de)
some 64bit test files may need to be fixed
Diffstat (limited to 'main')
-rw-r--r--main/snprintf.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/main/snprintf.c b/main/snprintf.c
index dc07f19437..81998cf970 100644
--- a/main/snprintf.c
+++ b/main/snprintf.c
@@ -155,10 +155,7 @@ PHPAPI char *php_gcvt(double value, int ndigit, char dec_point, char exponent, c
*dst++ = '-';
}
- for (i = 0; i < ndigit && digits[i] != '\0'; i++);
-
- if ((decpt >= 0 && decpt - i > 4)
- || (decpt < 0 && decpt < -3)) { /* use E-style */
+ if ((decpt >= 0 && decpt > ndigit) || decpt < -3) { /* use E-style */
/* exponential format (e.g. 1.2345e+13) */
if (--decpt < 0) {
sign = 1;