summaryrefslogtreecommitdiffstats
path: root/menu.c
diff options
context:
space:
mode:
authornicm <nicm>2023-02-05 21:26:48 +0000
committernicm <nicm>2023-02-05 21:26:48 +0000
commit0cb75f1332f7d2b5a3c610c2d76c5c53ef129c7c (patch)
tree41b2feff7ce89cc197147c49684d30eacc710868 /menu.c
parent93b1b781504f8de30f1858a4d0cf013396143c53 (diff)
Do not allow multiple line separators in a row.
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 0ff180aa..288030b2 100644
--- a/menu.c
+++ b/menu.c
@@ -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);