1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
naruse 2010-11-08 06:44:39 +00:00
parent 1f3e96b7ac
commit 599a7071c1
3 changed files with 8 additions and 0 deletions

View file

@ -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 */