applied Alex Sedov's Tab buffer termination patch, thanks
authorAnselm R Garbe <anselm@garbe.us>
Wed, 17 Apr 2013 18:59:12 +0000 (20:59 +0200)
committerAnselm R Garbe <anselm@garbe.us>
Wed, 17 Apr 2013 18:59:12 +0000 (20:59 +0200)
dmenu.c

diff --git a/dmenu.c b/dmenu.c
index efc1e54..c25dc82 100644 (file)
--- a/dmenu.c
+++ b/dmenu.c
@@ -392,7 +392,8 @@ keypress(XKeyEvent *ev) {
        case XK_Tab:
                if(!sel)
                        return;
-               strncpy(text, sel->text, sizeof text);
+               strncpy(text, sel->text, sizeof text - 1);
+               text[sizeof text - 1] = '\0';
                cursor = strlen(text);
                match();
                break;