summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-11-19 14:42:45 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-11-19 14:42:45 +0000
commit04f27f5e8ddbbc06544d96df4097e0300685a1cc (patch)
treeda51f25d928d2c8825aa66b1bf6c5f7880aa8e11 /string.c
parentdf96f994f1a224070ffaa61eb2bcb969d0109246 (diff)
* eval.c (rb_mod_modfunc): should follow NODE_ZSUPER link; based
on Guy Decoux's patch in [ruby-talk:25478]. * string.c (rb_str_succ): there was buffer overrun. * parse.y (str_extend): term can be any character. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1847 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 1c45632..1e55148 100644
--- a/string.c
+++ b/string.c
@@ -1018,7 +1018,7 @@ rb_str_succ(orig)
}
}
if (s < sbeg) {
- REALLOC_N(RSTRING(str)->ptr, char, RSTRING(str)->len + 1);
+ REALLOC_N(RSTRING(str)->ptr, char, RSTRING(str)->len + 2);
s = RSTRING(str)->ptr + n;
memmove(s+1, s, RSTRING(str)->len - n);
*s = c;