summaryrefslogtreecommitdiff
path: root/vsnprintf.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-08 06:44:39 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-08 06:44:39 +0000
commit599a7071c1789013dc8c8a4edeb5d54bc2fb71a6 (patch)
tree0884e6812de4fa89f3c0036479bcb77acbbfdf69 /vsnprintf.c
parent1f3e96b7ac73401c15df4d77bdcf6f441813c443 (diff)
downloadruby-599a7071c1789013dc8c8a4edeb5d54bc2fb71a6.tar.gz
* vsnprintf.c (BSD_vfprintf): fix precision specifier doesn't
work well on %f. [ruby-dev:42552] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vsnprintf.c')
-rw-r--r--vsnprintf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/vsnprintf.c b/vsnprintf.c
index 1ff061ed9c..5f564c2abf 100644
--- a/vsnprintf.c
+++ b/vsnprintf.c
@@ -855,6 +855,8 @@ fp_begin: _double = va_arg(ap, double);
size += prec + 1;
} else if (!prec) { /* "0" */
size = 1;
+ if (flags & ALT)
+ size += 1;
} else /* "0.X" */
size = prec + 2;
} else if (expt >= ndig) { /* fixed g fmt */