summaryrefslogtreecommitdiff
path: root/sprintf.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-15 14:08:46 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-15 14:08:46 +0000
commitd2cf4be9113d1e958eede3d760ffb1589df1115f (patch)
tree173774dfc4596d38447df7ea557a89ee806713ff /sprintf.c
parent897483c97955ee38181ee93a2d3317f61ee7d058 (diff)
merge revision(s) 16473:
* sprintf.c (rb_f_sprintf): fixed SEGV on win32 with "% 0e" % 1.0/0.0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_5@17309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sprintf.c b/sprintf.c
index 9ac3aa9873..b811a01458 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -743,6 +743,8 @@ rb_f_sprintf(argc, argv)
need = strlen(expr);
if ((!isnan(fval) && fval < 0.0) || (flags & FPLUS))
need++;
+ else if (flags & FSPACE)
+ need++;
if ((flags & FWIDTH) && need < width)
need = width;