diff options
| author | Anselm R Garbe <anselm@garbe.us> | 2013-04-17 20:59:12 +0200 |
|---|---|---|
| committer | Anselm R Garbe <anselm@garbe.us> | 2013-04-17 20:59:12 +0200 |
| commit | ec64f273fb7660d3746eb765dc02e40726a54294 (patch) | |
| tree | 8af2d1e68cde6477e99344f1957ea264d3be5c52 | |
| parent | 0d12a47415edba5db73f56dba76f123394581387 (diff) | |
applied Alex Sedov's Tab buffer termination patch, thanks
| -rw-r--r-- | dmenu.c | 3 |
1 files changed, 2 insertions, 1 deletions
| @@ -392,7 +392,8 @@ keypress(XKeyEvent *ev) { | |||
| 392 | case XK_Tab: | 392 | case XK_Tab: |
| 393 | if(!sel) | 393 | if(!sel) |
| 394 | return; | 394 | return; |
| 395 | strncpy(text, sel->text, sizeof text); | 395 | strncpy(text, sel->text, sizeof text - 1); |
| 396 | text[sizeof text - 1] = '\0'; | ||
| 396 | cursor = strlen(text); | 397 | cursor = strlen(text); |
| 397 | match(); | 398 | match(); |
| 398 | break; | 399 | break; |
