From 770d28b8c517fd87621ea3e8d6d7bdc4f35b3a94 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 1 Feb 2022 11:52:08 +0000 Subject: Do not overflow width when not enough space. --- menu.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'menu.c') diff --git a/menu.c b/menu.c index aaa1287e..c770cd7d 100644 --- a/menu.c +++ b/menu.c @@ -81,6 +81,8 @@ menu_add_item(struct menu *menu, const struct menu_item *item, menu->count--; return; } + if (c->tty.sx <= 4) + return; max_width = c->tty.sx - 4; slen = strlen(s); -- cgit v1.2.3