Skip to content

Commit

Permalink
pv_escape: Use utf8_to_uv, preferred to utf8_to_uvchr_buf
Browse files Browse the repository at this point in the history
  • Loading branch information
khwilliamson committed Jan 7, 2025
1 parent 7911101 commit 457c387
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,9 @@ Perl_pv_escape( pTHX_ SV *dsv, char const * const str,
isuni = 1;

for ( ; pv < end ; pv += readsize ) {
const UV u= (isuni) ? utf8_to_uvchr_buf((U8*)pv, (U8*) end, &readsize) : (U8)*pv;
const UV u = (isuni) /* Here known to be valid; checked just above */
? utf8_to_uv_or_die((U8*)pv, (U8*) end, &readsize)
: (U8) *pv;
const U8 c = (U8)u;
const char *source_buf = octbuf;

Expand Down

0 comments on commit 457c387

Please sign in to comment.