summaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-04 12:58:30 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-04 12:58:30 +0000
commit1f94291035eded4a0d9075c6272664fe448fa45b (patch)
tree00acc72229d17531a0125224f67bad63f85752d4 /string.c
parentd3948d9d40fa0dc2c49797d93dc1f39a35aca28c (diff)
downloadruby-1f94291035eded4a0d9075c6272664fe448fa45b.tar.gz
ruby-1f94291035eded4a0d9075c6272664fe448fa45b.tar.xz
ruby-1f94291035eded4a0d9075c6272664fe448fa45b.zip
* string.c (rb_str_dump): use MBCLEN_CHARFOUND_P properly.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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;
}
}