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
This commit is contained in:
Linus Nielsen Feltzing 2004-10-19 09:07:08 +00:00
parent ef8d508d5a
commit e88f8b1ffe

View file

@ -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;
}