El 10/10/26 a las 10:15, Roland Illig escribió:
Am 10.10.2026 um 10:01 schrieb Ramiro Aceves:return (ispunct((unsigned char) uc) || /* Posix: !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ */ uc == 0x002D || /* HYPHEN-MINUS */ uc == 0x058A || /* ARMENIAN HYPHEN */That fixes the undefined behavior but is still wrong. The letter U+0121 "ġ" is classified as a punctuation sign because its lower 8 bits are a punctuation sign. That's a wrong conclusion. Instead, the condition should be: (uc < 0x0080 && ispunct((unsigned char)uc)) || … In that code, the cast to unsigned char is not strictly necessary anymore, but I'd leave it there for static analyzers like lint(1). Roland
Hello Roland,
I have applied this patch as you suggested and compiled again. Will test on next saturday.
Thanks so much.
netbsd-nuc# cat /usr/pkgsrc/x11/xscreensaver/patches/patch-utils_utf8wc.c
$NetBSD$
--- utils/utf8wc.c.orig 2026-10-11 18:25:46.260960200 +0000
+++ utils/utf8wc.c
@@ -346,7 +346,7 @@ uc_ispunct (unsigned long uc)
https://www.unicode.org/reports/tr14/
...is a lot. But this is probably good enough?
*/
- return (ispunct((char) uc) || /* Posix: !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ */
+ return ((uc < 0x0080 && ispunct((unsigned char) uc)) || /* Posix: !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ */
uc == 0x002D || /* HYPHEN-MINUS */
uc == 0x058A || /* ARMENIAN HYPHEN */
uc == 0x05BE || /* HEBREW PUNCTUATION MAQAF */
netbsd-nuc#