From e88f8b1ffeb65042ee9877e92c30825635a68e84 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Tue, 19 Oct 2004 09:07:08 +0000 Subject: Deleting the last menu item no longer gives a negative cursor position git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5307 a1c6a512-1295-4272-9138-f99709370657 --- apps/menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/menu.c b/apps/menu.c index 2837974c9d..bdf255cc39 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; } -- cgit v1.2.3