diff options
author | nicm <nicm> | 2023-02-05 21:26:48 +0000 |
---|---|---|
committer | nicm <nicm> | 2023-02-05 21:26:48 +0000 |
commit | 0cb75f1332f7d2b5a3c610c2d76c5c53ef129c7c (patch) | |
tree | 41b2feff7ce89cc197147c49684d30eacc710868 /menu.c | |
parent | 93b1b781504f8de30f1858a4d0cf013396143c53 (diff) |
Do not allow multiple line separators in a row.
Diffstat (limited to 'menu.c')
-rw-r--r-- | menu.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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); |