[hackers] [dmenu] fix UB with the function iscntrl() || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Sat, 26 Mar 2022 18:00:03 +0100 (CET)

commit e73651f12a406629778f02d8e5acbe2caec0dfc2
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
AuthorDate: Sat Mar 26 17:58:47 2022 +0100
Commit: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
CommitDate: Sat Mar 26 17:58:47 2022 +0100

    fix UB with the function iscntrl()
    
    From commit 6818e07291f3b2913e687c8ec3d3fe4711724050 by NRK, thanks

diff --git a/dmenu.c b/dmenu.c
index 085dc29..839f6cc 100644
--- a/dmenu.c
+++ b/dmenu.c
_AT_@ -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:
Received on Sat Mar 26 2022 - 18:00:03 CET

This archive was generated by hypermail 2.3.0 : Sat Mar 26 2022 - 18:00:43 CET