summaryrefslogtreecommitdiff
path: root/sys/src/libc
diff options
context:
space:
mode:
authorppatience0 <ppatience0@gmail.com>2013-03-03 13:21:17 -0500
committerppatience0 <ppatience0@gmail.com>2013-03-03 13:21:17 -0500
commit1a8884406906d6b9e6fddffb609efa8b924939e7 (patch)
tree307b90800fdb25bca9bcba3449e853d4b74d5869 /sys/src/libc
parent3d908529e9f209be066b56be817f724a7b89d9c4 (diff)
fltfmt: %.0g should print with one significant figure
Diffstat (limited to 'sys/src/libc')
-rw-r--r--sys/src/libc/fmt/fltfmt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/src/libc/fmt/fltfmt.c b/sys/src/libc/fmt/fltfmt.c
index 84bd0c91c..aed8d9518 100644
--- a/sys/src/libc/fmt/fltfmt.c
+++ b/sys/src/libc/fmt/fltfmt.c
@@ -187,7 +187,7 @@ found:
* c3 digits of trailing '0'
* c4 digits after '.'
*/
- if(chr == 'g') /* Significant figures. */
+ if(chr == 'g' && prec > 0) /* Significant figures. */
prec--;
c1 = 0;
c2 = prec + 1;