ctype(3) misuse
The ctype(3) functions only accept, per ANSI and POSIX, values representable as unsigned char and EOF (which is usually -1).
NetBSD is especially picky about enforcing this.
I haven't seen any bad effects of this in mutt yet, but I noticed a compilation warning:
In file included from /usr/include/ctype.h:100,
from pager.c:44:
pager.c: In function 'is_ansi':
pager.c:1014:27: warning: array subscript has type 'char' [-Wchar-subscripts]
1014 | while (*buf && (isdigit(*buf) || *buf == ';'))
| ^
This could cause problems if buf ever is a Umlaut or other UTF-8 character.
The following patch fixes this:
--- pager.c.orig 2025-08-25 11:26:35.247435070 +0000
+++ pager.c
@@ -1011,7 +1011,7 @@ resolve_types (char *buf, char *raw, str
static int is_ansi (const char *buf)
{
- while (*buf && (isdigit(*buf) || *buf == ';'))
+ while (*buf && (isdigit((unsigned char)*buf) || *buf == ';'))
buf++;
return (*buf == 'm');
}