aboutsummaryrefslogtreecommitdiff
path: root/common/menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/menu.c')
-rw-r--r--common/menu.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/common/menu.c b/common/menu.c
index 5fb2ffbd06..f5fc6930a2 100644
--- a/common/menu.c
+++ b/common/menu.c
@@ -271,7 +271,10 @@ int menu_get_choice(struct menu *m, void **choice)
if (!m || !choice)
return -EINVAL;
- if (!m->prompt || m->item_cnt == 1)
+ if (!m->item_cnt)
+ return -ENOENT;
+
+ if (!m->prompt)
return menu_default_choice(m, choice);
return menu_interactive_choice(m, choice);