git: a37bc4cb8d2c - main - localedef: Fix a wchar_t comparison
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 20 Jun 2025 16:40:41 UTC
The branch main has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=a37bc4cb8d2c5c8402341c9df75580f60bb34186
commit a37bc4cb8d2c5c8402341c9df75580f60bb34186
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2025-06-20 16:10:57 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2025-06-20 16:39:22 +0000
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
---
usr.bin/localedef/collate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/usr.bin/localedef/collate.c b/usr.bin/localedef/collate.c
index 3dc70c7adf94..181d8ecd4840 100644
--- a/usr.bin/localedef/collate.c
+++ b/usr.bin/localedef/collate.c
@@ -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) {