X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fechochar.c;h=be8e68fc6fa404f1b2cefffadea3b78cf94d37ae;hp=ef649ca4f87246b188b39a8bc5ac6cebe58e8def;hb=7fa7badf32c514211478cf9f79c70f20d435c2f2;hpb=5d8dbcdd9423bf9821db414fd9ec792ccf1f1027 diff --git a/test/echochar.c b/test/echochar.c index ef649ca4..be8e68fc 100644 --- a/test/echochar.c +++ b/test/echochar.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: echochar.c,v 1.14 2017/09/04 11:48:15 tom Exp $ + * $Id: echochar.c,v 1.17 2017/10/11 08:16:12 tom Exp $ * * Demonstrate the echochar function (compare to dots.c). * Thomas Dickey - 2006/11/4 @@ -36,8 +36,6 @@ #include -#define valid(s) ((s != 0) && s != (char *)-1) - static bool interrupted = FALSE; static long total_chars = 0; static time_t started; @@ -47,7 +45,7 @@ cleanup(void) { exit_curses(); - printf("\n\n%ld total chars, rate %.2f/sec\n", + printf("\n\n%ld total cells, rate %.2f/sec\n", total_chars, ((double) (total_chars) / (double) (time((time_t *) 0) - started))); } @@ -103,8 +101,7 @@ main(int argc GCC_UNUSED, } } - CATCHALL(onsig); - initscr(); + InitAndCatch(initscr(), onsig); use_colors = has_colors(); if (use_colors) {