fix UB with the function iscntrl()
authorHiltjo Posthuma <hiltjo@codemadness.org>
Sat, 26 Mar 2022 16:58:47 +0000 (17:58 +0100)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Sat, 26 Mar 2022 16:58:47 +0000 (17:58 +0100)
From commit 6818e07291f3b2913e687c8ec3d3fe4711724050 by NRK, thanks

dmenu.c

diff --git a/dmenu.c b/dmenu.c
index 085dc292631e72778c05c31f4c4840d9ab0b0856..839f6ccd935f2755afa81afc7549ea95bc7b93aa 100644 (file)
--- a/dmenu.c
+++ b/dmenu.c
@@ -415,7 +415,7 @@ keypress(XKeyEvent *ev)
        switch(ksym) {
        default:
 insert:
-               if (!iscntrl(*buf))
+               if (!iscntrl((unsigned char)*buf))
                        insert(buf, len);
                break;
        case XK_Delete: