summaryrefslogtreecommitdiff
path: root/com32/menu/menumain.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-08-17 12:26:08 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-08-17 12:26:08 -0700
commit1e5b3e683aacab3f866abfa36e162177e80b6836 (patch)
treeb3606e3b9894abe50d13483746c93bcb85a932d4 /com32/menu/menumain.c
parent967ae0b3395e23b2f9e40d3981932a4202360504 (diff)
downloadsyslinux-1e5b3e683aacab3f866abfa36e162177e80b6836.tar.gz
menu: initialize cm (current menu) before empty check
The empty check in the menu system used "cm", but before "cm" had actually been initialized. Move the "cm" initialization earlier so we do the right thing here. Reported-by: CKSoon <cksoon79@yahoo.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32/menu/menumain.c')
-rw-r--r--com32/menu/menumain.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/com32/menu/menumain.c b/com32/menu/menumain.c
index 5b568feb..f3f0154b 100644
--- a/com32/menu/menumain.c
+++ b/com32/menu/menumain.c
@@ -1101,12 +1101,13 @@ int menu_main(int argc, char *argv[])
m->mparm[i] = max(m->mparm[i] + rows, 0);
}
+ cm = start_menu;
+
if (!cm->nentries) {
fputs("Initial menu has no LABEL entries!\n", stdout);
return 1; /* Error! */
}
- cm = start_menu;
for (;;) {
cmdline = run_menu();