diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-18 00:59:31 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-18 00:59:31 +0000 |
commit | a7e8b12f96bcea99a855092e4b200ddfed6c8c41 (patch) | |
tree | 23b19636a4f664fb37bab11c3dbf9942bd3a6457 /vsnprintf.c | |
parent | d41305b393d1aa33a93dcad15ee1424e24a1a737 (diff) | |
download | ruby-a7e8b12f96bcea99a855092e4b200ddfed6c8c41.tar.gz |
* sprintf.c (BSD_vfprintf): wrong padding arround prefix and
floating point with %a. [ruby-dev:42403] Bug #3956
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vsnprintf.c')
-rw-r--r-- | vsnprintf.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/vsnprintf.c b/vsnprintf.c index a1ac4424a2..1f53bc4265 100644 --- a/vsnprintf.c +++ b/vsnprintf.c @@ -829,6 +829,9 @@ fp_begin: _double = va_arg(ap, double); --expt; expsize = exponent(expstr, expt, ch + 'p' - 'a'); size = expsize + ndig; + size += 2; /* 0x */ + if (ndig > 1) + ++size; /* floating point */ } else if (ch <= 'e') { /* 'e' or 'E' fmt */ --expt; |