summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/menu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/menu.c b/apps/menu.c
index 2837974..bdf255c 100644
--- a/apps/menu.c
+++ b/apps/menu.c
@@ -434,7 +434,7 @@ void menu_delete(int menu, int position)
menus[menu].itemcount--;
/* adjust if this was the last menu item and the cursor was on it */
- if( menus[menu].itemcount <= menus[menu].cursor)
+ if(menus[menu].itemcount && menus[menu].itemcount <= menus[menu].cursor)
menus[menu].cursor = menus[menu].itemcount - 1;
}