head 1.1; access; symbols; locks; strict; comment @ * @; 1.1 date 2026.05.19.18.38.10; 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 --- answer.c.orig 2026-05-16 21:17:38.119293934 +0000 +++ answer.c @@@@ -8,7 +8,7 @@@@ #include #include #include -#include +#include "ctypeconv.h" #include "config.h" #include "global.h" #include "answer.h" @@@@ -203,10 +203,10 @@@@ ref_line(FILE * t) putc(' ', t); pos++; /* Skip leading white space. */ - while (*p && isascii(*p) && isspace(*p)) + while (*p && ISASCII(*p) && ISSPACE(*p)) p++; /* Output through next white space. */ - while (*p && !(isascii(*p) && isspace(*p))) { + while (*p && !(ISASCII(*p) && ISSPACE(*p))) { putc(*p++, t); pos++; } @