Do not overflow width when not enough space.

pull/3079/head
nicm 2022-02-01 11:52:08 +00:00
parent a6b361e775
commit 770d28b8c5
1 changed files with 2 additions and 0 deletions

2
menu.c
View File

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