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 <jb19357@protonmail.com>
Who used Claude to write a report.
This commit is contained in:
Hiltjo Posthuma 2026-09-13 20:31:37 +02:00
parent 7175c4880b
commit 5453bb65d9

View File

@ -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("<");