From 6ae8b15d939e12c25740864c119aff1886d5c350 Mon Sep 17 00:00:00 2001 From: akr Date: Wed, 4 Feb 2009 12:58:30 +0000 Subject: * string.c (rb_str_dump): use MBCLEN_CHARFOUND_P properly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'string.c') diff --git a/string.c b/string.c index 7781fa4b7e..ca06bf7253 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; } } -- cgit v1.2.3