Page MenuHomeFreeBSD

strfmon: Fix negative sign handling for C locale
ClosedPublic

Authored by jlduran on Nov 26 2025, 2:52 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, May 21, 8:07 PM
Unknown Object (File)
Sun, May 17, 11:52 AM
Unknown Object (File)
Sun, May 17, 9:08 AM
Unknown Object (File)
Sun, May 17, 9:08 AM
Unknown Object (File)
Sat, May 16, 7:23 PM
Unknown Object (File)
Sat, May 16, 6:54 PM
Unknown Object (File)
Sat, May 16, 6:27 PM
Unknown Object (File)
Sat, May 16, 2:35 PM
Subscribers

Details

Summary

If the locale's positive_sign and negative_sign values would both be
returned by localeconv() as empty strings, strfmon() shall behave as if
the negative_sign value was the string "-".

This occurs with the C locale. The implementation now checks that
int_{n,p}_sign_posn and {n,p}_sign_posn are properly initialized, as per
localeconv(3) - valid values are 0-4. If not initialized, they are set
to 1, which positions the sign before the string.

Austin Group Defect 1199 is applied, changing the requirements for the
'+' and '(' flags.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 68849
Build 65732: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Nov 26 2025, 5:07 PM

Sorry, I opted for a simpler fix.

This revision now requires review to proceed.Nov 26 2025, 7:23 PM
This revision is now accepted and ready to land.Nov 26 2025, 8:02 PM