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:
1 parent
7175c4880b
commit
5453bb65d9
1 file changed
+1
-1
@@ -171,7 +171,7 @@ drawmenu(void)
|
|||||||
/* draw vertical list */
|
/* draw vertical list */
|
||||||
for (item = curr; item != next; item = item->right)
|
for (item = curr; item != next; item = item->right)
|
||||||
drawitem(item, x, y += bh, mw - x);
|
drawitem(item, x, y += bh, mw - x);
|
||||||
} else if (matches) {
|
} else if (matches && curr) {
|
||||||
/* draw horizontal list */
|
/* draw horizontal list */
|
||||||
x += inputw;
|
x += inputw;
|
||||||
w = TEXTW("<");
|
w = TEXTW("<");
|
||||||
|
|||||||
Reference in new issue
Block a user