]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/inchs.c
ncurses 5.7 - patch 20090905
[ncurses.git] / test / inchs.c
index 38747a2f39bd2c70162b0b16831a420b99374f3a..180d3245db3388be1c9c268b93ce3ae8922d69f7 100644 (file)
@@ -26,7 +26,9 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: inchs.c,v 1.6 2007/06/09 21:25:06 tom Exp $
+ * $Id: inchs.c,v 1.9 2007/07/21 19:01:43 tom Exp $
+ *
+ * Author: Thomas E Dickey
  */
 /*
        chtype inch(void);
@@ -96,14 +98,14 @@ test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin)
 
     if ((fp = fopen(argv[level], "r")) != 0) {
        while ((j = fgetc(fp)) != EOF) {
-           if (waddch(txtwin, j) != OK) {
+           if (waddch(txtwin, UChar(j)) != OK) {
                break;
            }
        }
+       fclose(fp);
     } else {
        wprintw(txtwin, "Cannot open:\n%s", argv[1]);
     }
-    fclose(fp);
 
     while (!Quit(j = mvwgetch(txtwin, txt_y, txt_x))) {
        switch (j) {
@@ -266,5 +268,5 @@ main(int argc, char *argv[])
     test_inchs(1, argv, chrwin, strwin);
 
     endwin();
-    return EXIT_SUCCESS;
+    ExitProgram(EXIT_SUCCESS);
 }