diff options
author | bde <bde@FreeBSD.org> | 1995-04-06 16:28:15 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1995-04-06 16:28:15 +0000 |
commit | e7d4f4404cb357179f83e9dfbacfe330289fa84d (patch) | |
tree | 9350cd95bb4cb11fd271e61303df9bedcffc32a1 /lib/libc/stdio | |
parent | 9029dfd96c98cf80114b7029052832fe535be475 (diff) | |
download | FreeBSD-src-e7d4f4404cb357179f83e9dfbacfe330289fa84d.zip FreeBSD-src-e7d4f4404cb357179f83e9dfbacfe330289fa84d.tar.gz |
Obtained from: 1.1.5 (originally by jtc)
Fix printf("%g", 0.0) - print "0", not "0.". The previous fixes in this
area had one non-cosmetic (non-)change that caused this bug.
Bruce
Diffstat (limited to 'lib/libc/stdio')
-rw-r--r-- | lib/libc/stdio/vfprintf.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c index dc2769e..94e65cd 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); |