Source-Changes-HG archive

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

[src/trunk]: src/lib/libcurses don't coredump if we call endwin when initscr ...



details:   https://anonhg.NetBSD.org/src/rev/5253a742dc44
branches:  trunk
changeset: 349120:5253a742dc44
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Nov 24 14:49:08 2016 +0000

description:
don't coredump if we call endwin when initscr fails.

diffstat:

 lib/libcurses/tstp.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r cf8571eeaae6 -r 5253a742dc44 lib/libcurses/tstp.c
--- a/lib/libcurses/tstp.c      Thu Nov 24 12:38:32 2016 +0000
+++ b/lib/libcurses/tstp.c      Thu Nov 24 14:49:08 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tstp.c,v 1.40 2013/10/15 13:00:52 christos Exp $       */
+/*     $NetBSD: tstp.c,v 1.41 2016/11/24 14:49:08 christos Exp $       */
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)tstp.c     8.3 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: tstp.c,v 1.40 2013/10/15 13:00:52 christos Exp $");
+__RCSID("$NetBSD: tstp.c,v 1.41 2016/11/24 14:49:08 christos Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -218,6 +218,8 @@
 #ifdef DEBUG
        __CTRACE(__CTRACE_MISC, "__stopwin\n");
 #endif
+       if (_cursesi_screen == NULL)
+               return ERR;
        if (_cursesi_screen->endwin)
                return OK;
 



Home | Main Index | Thread Index | Old Index