Skip to content

Commit

Permalink
Prefer utf8_to_bytes_overwrite to utf8_to_bytes
Browse files Browse the repository at this point in the history
The latter has never lost its experimental status
  • Loading branch information
khwilliamson committed Jan 29, 2025
1 parent 63da182 commit 71404d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2789,7 +2789,7 @@ S_scomplement(pTHX_ SV *targ, SV *sv)
tmps = (U8*)SvPV_nomg(TARG, len);

if (SvUTF8(TARG)) {
if (len && ! utf8_to_bytes(tmps, &len)) {
if (len && ! utf8_to_bytes_overwrite(&tmps, &len)) {
Perl_croak(aTHX_ FATAL_ABOVE_FF_MSG, PL_op_desc[PL_op->op_type]);
}
SvCUR_set(TARG, len);
Expand Down
2 changes: 1 addition & 1 deletion sv.c
Original file line number Diff line number Diff line change
Expand Up @@ -3644,7 +3644,7 @@ Perl_sv_utf8_downgrade_flags(pTHX_ SV *const sv, const bool fail_ok, const U32 f
}
s = (U8 *) SvPV_flags(sv, len, mg_flags);

if (!utf8_to_bytes(s, &len)) {
if (!utf8_to_bytes_overwrite(&s, &len)) {
if (fail_ok)
return FALSE;
else {
Expand Down

0 comments on commit 71404d3

Please sign in to comment.