summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/string.c b/string.c
index 18c876dcf3..1a6eb07959 100644
--- a/string.c
+++ b/string.c
@@ -1365,11 +1365,11 @@ rb_str_inspect(str)
while (p < pend) {
char c = *p++;
if (ismbchar(c) && p < pend) {
- int len = mbclen(c)-1;
+ int len = mbclen(c);
CHECK(len);
*b++ = c;
- while (len--) {
+ while (--len) {
*b++ = *p++;
}
}