BSD 4_1_snap release
[unix-history] / usr / src / lib / libcurses / endwin.c
index f53a773..67e5cfb 100644 (file)
@@ -1,3 +1,9 @@
+/*
+ * Clean things up before exiting
+ *
+ * 1/26/81 (Berkeley) %W
+ */
+
 # include      "curses.ext"
 
 endwin()
 # include      "curses.ext"
 
 endwin()
@@ -5,9 +11,11 @@ endwin()
        resetty();
        _puts(VE);
        _puts(TE);
        resetty();
        _puts(VE);
        _puts(TE);
-       if (curscr->_flags & _STANDOUT) {
-               _puts(SE);
-               curscr->_flags &= ~_STANDOUT;
+       if (curscr) {
+               if (curscr->_flags & _STANDOUT) {
+                       _puts(SE);
+                       curscr->_flags &= ~_STANDOUT;
+               }
+               _endwin = TRUE;
        }
        }
-       _endwin = TRUE;
 }
 }