diff --git a/pp.c b/pp.c index 28c46ad5c21f..ad5ddd2dc898 100644 --- a/pp.c +++ b/pp.c @@ -6633,10 +6633,11 @@ PP_wrapped(pp_reverse, 0, 1) continue; } else { - if (!utf8_to_uvchr_buf(s, send, 0)) + Size_t advance = isUTF8_CHAR(s, send); + if (advance == 0) break; up = (char*)s; - s += UTF8SKIP(s); + s += advance; down = (char*)(s - 1); /* reverse this character */ while (down > up) {