diff options
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2719,7 +2719,7 @@ rb_str_inspect(str) while (p < pend) { char c = *p++; int len; - if (ismbchar(c) && p + (len = mbclen(c)) <= pend) { + if (ismbchar(c) && p - 1 + (len = mbclen(c)) <= pend) { rb_str_buf_cat(result, p - 1, len); p += len - 1; } |