summaryrefslogtreecommitdiffstats
path: root/menu.c
diff options
context:
space:
mode:
authornicm <nicm>2022-02-01 11:52:08 +0000
committernicm <nicm>2022-02-01 11:52:08 +0000
commit770d28b8c517fd87621ea3e8d6d7bdc4f35b3a94 (patch)
treef164ba6c750c51c47266324cda60dd3034f942f5 /menu.c
parenta6b361e775e0bf6301284391e75dd9af7af340da (diff)
Do not overflow width when not enough space.
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c2
1 files changed, 2 insertions, 0 deletions
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);