NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
lib/59807: strfmon: Bring back for the third (and hopefully definitive) time sign_posn = 1 when undefined
>Number: 59807
>Category: lib
>Synopsis: strfmon: Bring back for the third (and hopefully definitive) time sign_posn = 1 when undefined
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: lib-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Nov 30 03:30:00 +0000 2025
>Originator: Jose Luis Duran
>Release: trunk
>Organization:
FreeBSD
>Environment:
>Description:
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 previously assigned
"0" to sign_posn (parentheses around the entire string); now it assigns
it to "1" (sign before the string) when it is undefined (CHAR_MAX).
This was recommended by GNU C:
https://ftp.gnu.org/old-gnu/Manuals/glibc-2.2.3/html_node/libc_111.html
It was first added in strfmon.c,v 1.12.
Then removed in strfmon,v 1.17.
Then added back in strfmon.c,v 1.18
Then removed again in strfmon.c,v 1.20, this time requested by me.
Now I kindly request to bring it back again, this time with an Austin Group Defect to justify it:
https://www.austingroupbugs.net/view.php?id=1199
While fixing it, I also added the extra error [EINVAL] condition.
>How-To-Repeat:
See the updated tests below.
>Fix:
https://github.com/freebsd/freebsd-src/commit/cf85e7034ad5640b18a3b68d6b291b7bf89bfc80
EINVAL extra check:
https://github.com/freebsd/freebsd-src/commit/1fd018972a18b682521bb8f004dfd162327e5db2
Home |
Main Index |
Thread Index |
Old Index