From a7e8b12f96bcea99a855092e4b200ddfed6c8c41 Mon Sep 17 00:00:00 2001 From: naruse Date: Mon, 18 Oct 2010 00:59:31 +0000 Subject: * 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 --- vsnprintf.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'vsnprintf.c') 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; -- cgit v1.2.3