Skip to content

Commit 9a463d3

Browse files
committed
pp_pack: unpack: Use 'uv' form, not 'uvchr'
This converts a call to utf8n_to_uvchr(), using instead utf8_to_uv(). The flag parameter UTF8_ALLOW_DEFAULT before this commit is the default for utf8_to_uv(), so it can be omitted. Like previous commits, the previous code thought it was checking for failure and croaking, but was checking the wrong way so that it never could fail. In the new commit, I had to remove that checking, because it caused test suite failures.
1 parent b4df558 commit 9a463d3

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

pp_pack.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,10 +1326,7 @@ S_unpack_rec(pTHX_ tempsym_t* symptr, const char *s, const char *strbeg, const c
13261326
s = ptr;
13271327
}
13281328
else {
1329-
auv = utf8n_to_uvchr((U8*)s, strend - s, &retlen,
1330-
UTF8_ALLOW_DEFAULT);
1331-
if (retlen == (STRLEN) -1)
1332-
croak("Malformed UTF-8 string in unpack");
1329+
(void) utf8_to_uv((U8 *) s, (U8 *) strend, &auv, &retlen);
13331330
s += retlen;
13341331
}
13351332
if (!checksum)

0 commit comments

Comments
 (0)