From: nicm Date: Tue, 1 Feb 2022 11:52:08 +0000 (+0000) Subject: Do not overflow width when not enough space. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c985a7eab884a4d33dc6c2a69284df00909c0fa2;p=openbsd Do not overflow width when not enough space. --- diff --git a/usr.bin/tmux/menu.c b/usr.bin/tmux/menu.c index bb0d6c574a5..d5fc75c15a2 100644 --- a/usr.bin/tmux/menu.c +++ b/usr.bin/tmux/menu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: menu.c,v 1.41 2021/11/11 09:22:33 nicm Exp $ */ +/* $OpenBSD: menu.c,v 1.42 2022/02/01 11:52:08 nicm Exp $ */ /* * Copyright (c) 2019 Nicholas Marriott @@ -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);