summaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-04-08 13:05:07 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-04-08 13:05:07 +0000
commit09978bfd11c45aa84f21f8f3feb8d1fd443a9ae5 (patch)
tree950fd093eb3040ffa35cacdf1262fc0eb534b588 /string.c
parente28369ebe894cb8e0b6fd6eee6a51f41a44469d8 (diff)
downloadruby-09978bfd11c45aa84f21f8f3feb8d1fd443a9ae5.tar.gz
ruby-09978bfd11c45aa84f21f8f3feb8d1fd443a9ae5.tar.xz
ruby-09978bfd11c45aa84f21f8f3feb8d1fd443a9ae5.zip
* string.c (rb_str_dump): buffer length plus one byte for null
terminator. [ruby-dev:38294] * test/ruby/test_m17n.rb (test_str_dump): add a test for above. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string.c b/string.c
index 2b790a082..7d96cdbc1 100644
--- a/string.c
+++ b/string.c
@@ -4291,7 +4291,7 @@ rb_str_dump(VALUE str)
result = rb_str_new5(str, 0, len);
p = RSTRING_PTR(str); pend = p + RSTRING_LEN(str);
- q = RSTRING_PTR(result); qend = q + len;
+ q = RSTRING_PTR(result); qend = q + len + 1;
*q++ = '"';
while (p < pend) {