summaryrefslogtreecommitdiff
path: root/lib/libc/stdio
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1995-04-06 16:28:15 +0000
committerBruce Evans <bde@FreeBSD.org>1995-04-06 16:28:15 +0000
commitffe57f1a203a44c43b46a9ef12c8289fd41277ff (patch)
tree9350cd95bb4cb11fd271e61303df9bedcffc32a1 /lib/libc/stdio
parentf85e2485b8808f495ce7f138c8548a73c8b667d4 (diff)
Notes
Diffstat (limited to 'lib/libc/stdio')
-rw-r--r--lib/libc/stdio/vfprintf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c
index dc2769e4d0af..94e65cd5433b 100644
--- a/lib/libc/stdio/vfprintf.c
+++ b/lib/libc/stdio/vfprintf.c
@@ -730,7 +730,8 @@ number: if ((dprec = prec) >= 0)
if (ch >= 'f') { /* 'f' or 'g' */
if (_double == 0) {
/* kludge for __dtoa irregularity */
- if (prec == 0 && (flags & ALT) == 0) {
+ if (expt >= ndig &&
+ (flags & ALT) == 0) {
PRINT("0", 1);
} else {
PRINT("0.", 2);