Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/menuc In procese_menu, make sure we initializie the ...



details:   https://anonhg.NetBSD.org/src/rev/04a765ac4c77
branches:  trunk
changeset: 570010:04a765ac4c77
user:      wrstuden <wrstuden%NetBSD.org@localhost>
date:      Fri Sep 17 18:27:28 2004 +0000

description:
In procese_menu, make sure we initializie the menus
_before_ we access the MENUS macro. Otherwise we get a segfault.

diffstat:

 usr.bin/menuc/menu_sys.def |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (26 lines):

diff -r 29d930f8ae8b -r 04a765ac4c77 usr.bin/menuc/menu_sys.def
--- a/usr.bin/menuc/menu_sys.def        Fri Sep 17 18:16:44 2004 +0000
+++ b/usr.bin/menuc/menu_sys.def        Fri Sep 17 18:27:28 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: menu_sys.def,v 1.56 2004/09/17 18:15:01 wrstuden Exp $ */
+/*     $NetBSD: menu_sys.def,v 1.57 2004/09/17 18:27:28 wrstuden Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -645,14 +645,14 @@
 
        menudesc *m;
 
-       m = &MENUS(num);
-
        /* Initialize? */
        if (menu_init()) {
                __menu_initerror();
                return;
        }
 
+       m = &MENUS(num);
+
        /* Default to select option 0 and display from 0 */
        m->topline = 0;
        if ((m->mopt & (MC_DFLTEXIT | MC_NOEXITOPT)) == MC_DFLTEXIT)



Home | Main Index | Thread Index | Old Index