head 1.1; access; symbols; locks; strict; comment @ * @; 1.1 date 2026.05.19.18.38.11; author spz; state Exp; branches; next ; commitid 5x0jwzSnfR7nhsGG; desc @@ 1.1 log @deal with ctype functions faulting on invalid input on NetBSD 11 (by making invalid input less likely) While at it add LICENSE @ text @$NetBSD$ deal with ctype functions faulting on invalid input on NetBSD 11 --- menu.c.orig 2026-05-16 21:27:55.837783975 +0000 +++ menu.c @@@@ -6,7 +6,7 @@@@ */ #include -#include +#include "ctypeconv.h" #include "config.h" #include "global.h" #include "articles.h" @@@@ -1025,12 +1025,12 @@@@ get_purpose(char *purpose) len = current_group->group_name_length; while (fgets(line, 256, f) != NULL) { - if (!isascii(line[len]) || !isspace(line[len])) + if (!ISASCII(line[len]) || !ISSPACE(line[len])) continue; if (strncmp(line, group, len)) continue; cp = line + len; - while (*cp && isspace(*cp)) + while (*cp && ISSPACE(*cp)) cp++; for (pp = purpose, len = 76; --len >= 0 && *cp && *cp != NL;) *pp++ = *cp++; @