Skip to content

Commit

Permalink
lex_peek_unichar: Use utf8_to_uv_or_die
Browse files Browse the repository at this point in the history
  • Loading branch information
khwilliamson committed Jan 7, 2025
1 parent 6c4c496 commit 8fbaa65
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions toke.c
Original file line number Diff line number Diff line change
Expand Up @@ -1634,14 +1634,8 @@ Perl_lex_peek_unichar(pTHX_ U32 flags)
bufend = PL_parser->bufend;
}
}
unichar = utf8n_to_uvchr((U8*)s, bufend-s, &retlen, UTF8_CHECK_ONLY);
if (retlen == (STRLEN)-1) {
force_out_malformed_utf8_message_((U8 *) s,
(U8 *) bufend,
0,
MALFORMED_UTF8_DIE);
NOT_REACHED; /* NOTREACHED */
}

unichar = utf8_to_uv_or_die((U8*)s, (U8*) bufend, NULL);
return unichar;
} else {
if (s == bufend) {
Expand Down

0 comments on commit 8fbaa65

Please sign in to comment.