]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/inch_wide.c
ncurses 5.7 - patch 20100403
[ncurses.git] / test / inch_wide.c
index 069e8738eeca4703c73330be935173f07ea67fe5..25af426aba8051cf8f79531c74b972693aa616ee 100644 (file)
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: inch_wide.c,v 1.4 2007/06/09 21:25:54 tom Exp $
+ * $Id: inch_wide.c,v 1.6 2007/07/21 18:37:38 tom Exp $
  */
 /*
        int in_wch(cchar_t *wcval);
@@ -99,14 +99,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) {
@@ -267,7 +267,7 @@ main(int argc, char *argv[])
     test_inchs(1, argv, chrwin, strwin);
 
     endwin();
-    return EXIT_SUCCESS;
+    ExitProgram(EXIT_SUCCESS);
 }
 #else
 int