diff options
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1652,7 +1652,7 @@ rb_str_splice(str, beg, len, val) } beg += RSTRING(str)->len; } - if (RSTRING(str)->len < beg + len) { + if (RSTRING(str)->len < len || RSTRING(str)->len < beg + len) { len = RSTRING(str)->len - beg; } |