Don't set selection if there are no pages

This commit is contained in:
adnano 2024-02-26 15:05:37 -05:00
parent 7284f5958b
commit da25fbfb27

2
main.c
View file

@ -236,8 +236,10 @@ static void match_items(struct menu *menu) {
} }
page_items(menu); page_items(menu);
if (menu->pages) {
menu->sel = menu->pages->first; menu->sel = menu->pages->first;
} }
}
static void insert(struct menu *menu, const char *s, ssize_t n) { static void insert(struct menu *menu, const char *s, ssize_t n) {
if (strlen(menu->text) + n > sizeof menu->text - 1) { if (strlen(menu->text) + n > sizeof menu->text - 1) {