diff options
author | Frank Wunderlich <frank-w@public-files.de> | 2018-12-03 11:23:41 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-12-07 08:13:48 -0500 |
commit | bace22175b7ab96d4caacfcb6d1d6b990eca93c1 (patch) | |
tree | b5bbb3099abee265bae100ca868d74f363d377fd /cmd/bootmenu.c | |
parent | 530b63c2286d8c19b20a15ca57e20af6c0f08739 (diff) | |
download | u-boot-bace22175b7ab96d4caacfcb6d1d6b990eca93c1.tar.gz |
ensure active menuitem is inside menu
Hi,
setting active menuitem currently can be outside of menu which results in invisible selection
attached Patch fixes this
regards Frank
>From 1d9c4cb8b3e2dd9b0a7a6a2d4a21684d0a099dbf Mon Sep 17 00:00:00 2001
From: Frank Wunderlich <frank-w@public-files.de>
Date: Sun, 2 Dec 2018 11:23:53 +0100
Subject: [PATCH] ensure active menuitem is inside menu
if active menuitem is defined via environment var it can be outside the menu (>=menuitem-count)
this patch resets this definition back to 0
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Diffstat (limited to 'cmd/bootmenu.c')
-rw-r--r-- | cmd/bootmenu.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd/bootmenu.c b/cmd/bootmenu.c index 979ac4a638..7f88c1ed63 100644 --- a/cmd/bootmenu.c +++ b/cmd/bootmenu.c @@ -351,6 +351,12 @@ static struct bootmenu_data *bootmenu_create(int delay) } menu->count = i; + + if ((menu->active >= menu->count)||(menu->active < 0)) { //ensure active menuitem is inside menu + printf("active menuitem (%d) is outside menu (0..%d)\n",menu->active,menu->count-1); + menu->active=0; + } + return menu; cleanup: |