aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2020-10-02 06:31:11 +0200
committerPřemysl Eric Janouch <p@janouch.name>2020-10-02 06:31:46 +0200
commit7f919025ee56cfbdc5b3e6cab88d43cbdcae58e1 (patch)
tree73cebe4a6879a33e14299a5287032cf36dcfb009
parent1a76b2032e6d18d9f95d9d0bb98edc26023c8618 (diff)
downloadliberty-7f919025ee56cfbdc5b3e6cab88d43cbdcae58e1.tar.gz
liberty-7f919025ee56cfbdc5b3e6cab88d43cbdcae58e1.tar.xz
liberty-7f919025ee56cfbdc5b3e6cab88d43cbdcae58e1.zip
Add iscntrl_ascii()
It's too easy to miss the DEL character.
-rw-r--r--liberty.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/liberty.c b/liberty.c
index 6a771be..6f44df0 100644
--- a/liberty.c
+++ b/liberty.c
@@ -2673,6 +2673,12 @@ strncasecmp_ascii (const char *a, const char *b, size_t n)
}
static bool
+iscntrl_ascii (int c)
+{
+ return (c >= 0 && c < 32) || c == 0x7f;
+}
+
+static bool
isalpha_ascii (int c)
{
c &= ~32;