localedef: Fix a wchar_t comparison

The intent here is to characterize wide characters which fit in a single
byte.  When wchar_t is signed, this comparison is insufficient.

On systems with signed wchar_t, of the files in /usr/share/locale this
only affects zh_CN.GB18030/LC_COLLATE.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D50757
This commit is contained in:
Mark Johnston 2025-06-20 16:10:57 +00:00
parent 770fba248d
commit a37bc4cb8d

View file

@ -1273,7 +1273,7 @@ dump_collate(void)
RB_FOREACH(cc, collchars, &collchars) {
int undef = 0;
/* we already gathered those */
if (cc->wc <= UCHAR_MAX)
if ((uint32_t)cc->wc <= UCHAR_MAX)
continue;
for (j = 0; j < NUM_WT; j++) {
if ((pri = get_weight(cc->ref[j], j)) < 0) {