Skip to content

Commit 8fbaa65

Browse files
committed
lex_peek_unichar: Use utf8_to_uv_or_die
1 parent 6c4c496 commit 8fbaa65

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

toke.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,14 +1634,8 @@ Perl_lex_peek_unichar(pTHX_ U32 flags)
16341634
bufend = PL_parser->bufend;
16351635
}
16361636
}
1637-
unichar = utf8n_to_uvchr((U8*)s, bufend-s, &retlen, UTF8_CHECK_ONLY);
1638-
if (retlen == (STRLEN)-1) {
1639-
force_out_malformed_utf8_message_((U8 *) s,
1640-
(U8 *) bufend,
1641-
0,
1642-
MALFORMED_UTF8_DIE);
1643-
NOT_REACHED; /* NOTREACHED */
1644-
}
1637+
1638+
unichar = utf8_to_uv_or_die((U8*)s, (U8*) bufend, NULL);
16451639
return unichar;
16461640
} else {
16471641
if (s == bufend) {

0 commit comments

Comments
 (0)