summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2003-02-12 20:41:53 +0000
committerIlia Alshanetsky <iliaa@php.net>2003-02-12 20:41:53 +0000
commitf924aaf6470847192d79cdbb3d69c95b5b50036d (patch)
tree504e7f752574c82d93c266e3e7dfd5ec80d215bf
parent0cb1ff3bdadd3f39f09b55b5a17c95f613b714e6 (diff)
downloadphp-git-f924aaf6470847192d79cdbb3d69c95b5b50036d.tar.gz
Fixed bug #22187 (spprintf function did not handle floats correctly).
-rw-r--r--main/snprintf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/snprintf.c b/main/snprintf.c
index a8f7d75f60..fa5a07cc45 100644
--- a/main/snprintf.c
+++ b/main/snprintf.c
@@ -298,7 +298,7 @@ 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) {
+ while ((fj = arg * 10) < 1 && (r2 * -1) < ndigits) {
arg = fj;
r2--;
}