]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/demo_new_pair.c
ncurses 6.2 - patch 20200321
[ncurses.git] / test / demo_new_pair.c
index 4067c8817ad3532f43174415272233e90fdbb860..bd62a089741ff6d9f768068a5517335eb29d672b 100644 (file)
@@ -1,5 +1,6 @@
 /****************************************************************************
- * Copyright (c) 2017 Free Software Foundation, Inc.                        *
+ * Copyright 2018-2019,2020 Thomas E. Dickey                                *
+ * Copyright 2017 Free Software Foundation, Inc.                            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -26,7 +27,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: demo_new_pair.c,v 1.18 2017/10/11 22:16:14 tom Exp $
+ * $Id: demo_new_pair.c,v 1.21 2020/02/02 23:34:34 tom Exp $
  *
  * Demonstrate the alloc_pair() function.
  */
@@ -223,7 +224,7 @@ main(int argc, char *argv[])
 
     if (isatty(fileno(stderr))) {
        output = stderr;
-    } else if ((ch = open("/dev/tty", O_WRONLY)) != 0) {
+    } else if ((ch = open("/dev/tty", O_WRONLY)) >= 0) {
        output = fdopen(ch, "w");
     } else {
        fprintf(stderr, "cannot open terminal for output\n");
@@ -336,7 +337,7 @@ main(int argc, char *argv[])
        total_cells += 1 + (use_wide ? 1 : 0);
        ++current;
     }
-    exit_curses();
+    stop_curses();
     fclose(output);
 
     printf("%.1f cells/second\n",