The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=10d14a37206e77e050676c8fbd96600f9101cf8b
commit 10d14a37206e77e050676c8fbd96600f9101cf8b Author: Mark Johnston <ma...@freebsd.org> AuthorDate: 2025-06-20 16:10:57 +0000 Commit: Mark Johnston <ma...@freebsd.org> CommitDate: 2025-07-09 00:42:52 +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 (cherry picked from commit a37bc4cb8d2c5c8402341c9df75580f60bb34186) --- 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 2a080773a95e..da3f26b4d0ba 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) {