summaryrefslogtreecommitdiffstats
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 7781fa4b7..ca06bf725 100644
--- a/string.c
+++ b/string.c
@@ -4186,12 +4186,12 @@ rb_str_dump(VALUE str)
else {
if (u8) { /* \u{NN} */
char buf[32];
- int n = rb_enc_precise_mbclen(p-1, pend, enc) - 1;
+ int n = rb_enc_precise_mbclen(p-1, pend, enc);
if (MBCLEN_CHARFOUND_P(n)) {
int cc = rb_enc_codepoint(p-1, pend, enc);
sprintf(buf, "%x", cc);
len += strlen(buf)+4;
- p += n;
+ p += MBCLEN_CHARFOUND_LEN(n)-1;
break;
}
}