From: nicm Date: Sun, 5 Feb 2023 21:26:48 +0000 (+0000) Subject: Do not allow multiple line separators in a row. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=422252e0378887088212610d259eb5d06b870c03;p=openbsd Do not allow multiple line separators in a row. --- diff --git a/usr.bin/tmux/menu.c b/usr.bin/tmux/menu.c index 52387036430..e1efa60e72d 100644 --- a/usr.bin/tmux/menu.c +++ b/usr.bin/tmux/menu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: menu.c,v 1.48 2023/01/20 21:36:00 nicm Exp $ */ +/* $OpenBSD: menu.c,v 1.49 2023/02/05 21:26:48 nicm Exp $ */ /* * Copyright (c) 2019 Nicholas Marriott @@ -64,6 +64,8 @@ menu_add_item(struct menu *menu, const struct menu_item *item, line = (item == NULL || item->name == NULL || *item->name == '\0'); if (line && menu->count == 0) return; + if (line && menu->items[menu->count - 1].name == NULL) + return; menu->items = xreallocarray(menu->items, menu->count + 1, sizeof *menu->items);