4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-21 00:07:36 +08:00
Corinna Vinschen ed18acfe8c strcasecmp family: cast character to unsigned when calling tolower
The strcasecmp family of functions (strcasecmp, strncasecmp,
strcasecmp_l, strncasecmp_l) call tolower on the incoming
character before comparison.  tolower takes an int as parameter.
All four strcasecmp functions neglect to cast the character to
unsigned before using it as parameter to tolower.  This tolower
is called with negative values if the incoming character is not
in the ASCII range.  This breaks case-insensitive comparison in
other singlebyte codesets like ISO-8859-1 with native characters.

Adding casts to unsigned char when calling tolower fixes it.

Reported-by: Bruno Haible <bruno@clisp.org>
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-02-17 10:52:28 +01:00
..
2024-12-16 10:24:53 +01:00
2023-08-09 11:38:03 +02:00
2023-07-18 13:43:29 -04:00
2024-12-31 20:35:33 -05:00