From 5453bb65d98b466ea38494a867358fc9eed2250f Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Sun, 13 Sep 2026 20:31:37 +0200 Subject: [PATCH] fix crash with long prompt and pressing the end key in horizontal mode Reproducable with: printf 'a\nb\n' | ./dmenu -p "$(printf 'x%.0s' $(seq 1 400))" and then pressing the end key. Reported by: jb19357 Who used Claude to write a report. --- dmenu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dmenu.c b/dmenu.c index 363d19f..64ff973 100644 --- a/dmenu.c +++ b/dmenu.c @@ -171,7 +171,7 @@ drawmenu(void) /* draw vertical list */ for (item = curr; item != next; item = item->right) drawitem(item, x, y += bh, mw - x); - } else if (matches) { + } else if (matches && curr) { /* draw horizontal list */ x += inputw; w = TEXTW("<");