When determining the length of buffer needed to output the decimal point
in the current locale, use SvCUR(PL_numeric_radix_sv) rather than
SvLEN(PL_numeric_radix_sv). I presume this was a thinko in the original
commit. Using SvLEN currently seems harmless, since typically SvCUR <
SvLEN, but one could conceive a future scenario where locale info is set
using alien string buffers with SvLEN(sv) == 0.
STORE_LC_NUMERIC_SET_TO_NEEDED();
local_radix = PL_numeric_local && PL_numeric_radix_sv;
- if (local_radix && SvLEN(PL_numeric_radix_sv) > 1) {
- size += SvLEN(PL_numeric_radix_sv) - 1;
+ if (local_radix && SvCUR(PL_numeric_radix_sv) > 1) {
+ size += SvCUR(PL_numeric_radix_sv) - 1;
s = SvGROW_mutable(sv, size);
}
#ifdef USE_LOCALE_NUMERIC
STORE_LC_NUMERIC_SET_TO_NEEDED();
if (PL_numeric_radix_sv && IN_LC(LC_NUMERIC))
- float_need += SvLEN(PL_numeric_radix_sv);
+ float_need += SvCUR(PL_numeric_radix_sv);
RESTORE_LC_NUMERIC();
#endif
}