Skip to content

Commit 24ec8e7

Browse files
committed
pv_escape: Use utf8_to_uv, preferred to utf8_to_uvchr_buf
1 parent a307b4d commit 24ec8e7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

dump.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,9 @@ Perl_pv_escape( pTHX_ SV *dsv, char const * const str,
232232
isuni = 1;
233233

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

0 commit comments

Comments
 (0)