summaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
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 1c45632b7..1e55148f4 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;