summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-19 05:21:34 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-19 05:21:34 +0000
commit62c3a35d4223c7fc9b3c588acfa26cfabc0852fc (patch)
tree3c2743f31f19db981605eb8aa4c11799a669b5d3
parentc7e035a262c8eb729f79b6282eecae04be5dbbe3 (diff)
* 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@16473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--sprintf.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index b0d73e6bbb..9e39343405 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Mon May 19 14:20:13 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * sprintf.c (rb_f_sprintf): fixed SEGV on win32 with "% 0e" % 1.0/0.0.
+
Mon May 19 13:29:58 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* process.c (rb_f_system): set last_status when status == -1 because
diff --git a/sprintf.c b/sprintf.c
index c5334b1f9f..cf8ea20de6 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -729,6 +729,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;