aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnselm R Garbe <anselm@garbe.us>2013-04-17 20:59:12 +0200
committerAnselm R Garbe <anselm@garbe.us>2013-04-17 20:59:12 +0200
commitec64f273fb7660d3746eb765dc02e40726a54294 (patch)
tree8af2d1e68cde6477e99344f1957ea264d3be5c52
parent0d12a47415edba5db73f56dba76f123394581387 (diff)
downloaddmenu-ec64f273fb7660d3746eb765dc02e40726a54294.tar.gz
dmenu-ec64f273fb7660d3746eb765dc02e40726a54294.tar.bz2
dmenu-ec64f273fb7660d3746eb765dc02e40726a54294.zip
applied Alex Sedov's Tab buffer termination patch, thanks
-rw-r--r--dmenu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/dmenu.c b/dmenu.c
index efc1e54..c25dc82 100644
--- 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;