Source-Changes-HG archive

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

[src/trunk]: src/distrib/utils/sysinst initialize the menu systerm before set...



details:   https://anonhg.NetBSD.org/src/rev/7e6fa0a33f0a
branches:  trunk
changeset: 473789:7e6fa0a33f0a
user:      cgd <cgd%NetBSD.org@localhost>
date:      Sat Jun 19 06:52:22 1999 +0000

description:
initialize the menu systerm before setting up the message window.  Then
use stdscr's maxx and maxy to set up the message window rather than hard
coding 78 and 22, respectively.  The latter, combined with large messages
and a relatively small screen (and perhaps badly-placed menus), would seem
to cause the SEGVs reported in PR#7806.  (For certain window sizes, the
menu system would reject the menus as too small, but for others sysinst
would just crash.)

diffstat:

 distrib/utils/sysinst/main.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 22379b0ba160 -r 7e6fa0a33f0a distrib/utils/sysinst/main.c
--- a/distrib/utils/sysinst/main.c      Sat Jun 19 06:38:49 1999 +0000
+++ b/distrib/utils/sysinst/main.c      Sat Jun 19 06:52:22 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.14 1999/06/18 08:54:28 cgd Exp $    */
+/*     $NetBSD: main.c,v 1.15 1999/06/19 06:52:22 cgd Exp $    */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -109,7 +109,15 @@
        
 
        /* initialize message window */
-       win = newwin(22, 78, 1, 1);     /* XXX BOGUS XXX */
+       if (menu_init()) {
+               __menu_initerror();
+               exit(1);
+       }
+       /*
+        * XXX the following is bogus.  if screen is too small, message
+        * XXX window will be overwritten by menus.
+        */
+       win = newwin(getmaxy(stdscr) - 2, getmaxx(stdscr) - 2, 1, 1);
                msg_window(win);
 
        /* Watch for SIGINT and clean up */



Home | Main Index | Thread Index | Old Index