From 7f919025ee56cfbdc5b3e6cab88d43cbdcae58e1 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Fri, 2 Oct 2020 06:31:11 +0200 Subject: Add iscntrl_ascii() It's too easy to miss the DEL character. --- liberty.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/liberty.c b/liberty.c index 6a771be..6f44df0 100644 --- a/liberty.c +++ b/liberty.c @@ -2672,6 +2672,12 @@ strncasecmp_ascii (const char *a, const char *b, size_t n) return 0; } +static bool +iscntrl_ascii (int c) +{ + return (c >= 0 && c < 32) || c == 0x7f; +} + static bool isalpha_ascii (int c) { -- cgit v1.2.3-70-g09d2