summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2010-02-15 16:10:28 +0000
committerCorinna Vinschen <corinna@vinschen.de>2010-02-15 16:10:28 +0000
commitb85c06ba36da589ef74b0e9ecb129627b5c06fc7 (patch)
tree8de084e1df44279ca0780cfebfdcf320c82a6ef8
parent0da7a27a1b3457f74997f44350633cd16cd1dd11 (diff)
downloadcygnal-b85c06ba36da589ef74b0e9ecb129627b5c06fc7.tar.gz
cygnal-b85c06ba36da589ef74b0e9ecb129627b5c06fc7.tar.bz2
cygnal-b85c06ba36da589ef74b0e9ecb129627b5c06fc7.zip
* libc/stdio/vfprintf.c (_VFPRINTF_R): Drop printing a redundant
decimal point in case the float argument is an integral value.
-rw-r--r--newlib/ChangeLog5
-rw-r--r--newlib/libc/stdio/vfprintf.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index f962a3c8f..2ba3d3b59 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,8 @@
+2010-02-15 Corinna Vinschen <corinna@vinschen.de>
+
+ * libc/stdio/vfprintf.c (_VFPRINTF_R): Drop printing a redundant
+ decimal point in case the float argument is an integral value.
+
2010-02-11 Craig Howland <howland@LGSInnovations.com>
* libc/include/machine/ieeefp.h: isfinite macro modified to run faster
diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c
index be4170cc2..be35d248c 100644
--- a/newlib/libc/stdio/vfprintf.c
+++ b/newlib/libc/stdio/vfprintf.c
@@ -1578,7 +1578,7 @@ number: if ((dprec = prec) >= 0)
cp = convbuf + ndig;
}
#endif
- if (prec || flags & ALT)
+ if (expt < ndig || flags & ALT)
PRINT (decimal_point, decp_len);
PRINTANDPAD (cp, convbuf + ndig,
ndig - expt, zeroes);