summaryrefslogtreecommitdiffstats
path: root/sprintf.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-25 09:51:20 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-25 09:51:20 +0000
commit9562385288501255b025cb8627db06090ad76d19 (patch)
tree19cc5dc0a5292ee2c273785e4dfcd33f1d4bdcbe /sprintf.c
parentb9bfa39d146db783083940e943e2224dfd81518b (diff)
merges r20911 and 20921 from trunk into ruby_1_9_1.
* missing/vsnprintf.c (BSD_vfprintf): fix for test_sprintf_comb.rb, by wanabe in [ruby-dev:36935]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@20999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sprintf.c b/sprintf.c
index 1195f9b17..cc8f097e5 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -979,8 +979,8 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
if ((flags & FWIDTH) && need < width)
need = width;
- CHECK(need);
- snprintf(&buf[blen], need, "%*s", need, "");
+ CHECK(need + 1);
+ snprintf(&buf[blen], need + 1, "%*s", need, "");
if (flags & FMINUS) {
if (!isnan(fval) && fval < 0.0)
buf[blen++] = '-';