Subject: bin/1015: systat core dumps without term variable set
To: None <gnats-admin@sun-lamp.cs.berkeley.edu>
From: James Jegers <jimj@enigma.cs.uwm.edu>
List: netbsd-bugs
Date: 05/03/1995 08:35:03
>Number: 1015
>Category: bin
>Synopsis: systat core dumps without term variable set
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people (Utility Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed May 3 08:35:02 1995
>Originator: James Jegers
>Organization:
>Release: Current as of 5/2/95<NetBSD-current source date>
>Environment:
System: NetBSD enigma.cs.uwm.edu 1.0A NetBSD 1.0A (ENIGMA) #0: Wed Apr 19 22:19:50 CDT 1995 jimj@enigma.cs.uwm.edu:/usr/src/sys/arch/i386/compile/ENIGMA i386
>Description:
Running systat without a terminal type set will cause it to coredump.
>How-To-Repeat:
Script started on Wed May 3 10:18:11 1995
%m %/-> set term =
%m %/-> systat
Segmentation fault
%m %/-> systat -v
systat: couldn't initialize display
Segmentation fault
%m %/-> exit
>Fix:
diff -c3 systat/main.c systat.new/main.c
*** systat/main.c Wed May 3 10:08:23 1995
--- systat.new/main.c Wed May 3 10:21:49 1995
***************
*** 128,134 ****
* an overlapping sub-window of stdscr configured by the display
* routines to minimize update work by curses.
*/
! initscr();
CMDLINE = LINES - 1;
wnd = (*curcmd->c_open)();
if (wnd == NULL) {
--- 128,139 ----
* an overlapping sub-window of stdscr configured by the display
* routines to minimize update work by curses.
*/
! if (initscr() == NULL)
! {
! warnx("couldn't initialize screen");
! exit(0);
! }
!
CMDLINE = LINES - 1;
wnd = (*curcmd->c_open)();
if (wnd == NULL) {
>Audit-Trail:
>Unformatted: