From: Christian Groessler Date: Tue, 25 Sep 2018 12:35:52 +0000 (+0200) Subject: clock-test.c: do doesclrscrafterexit() handling the canonical way. X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1203e9e0c4d7a3c90736a78b53079e9d584fc084;p=cc65 clock-test.c: do doesclrscrafterexit() handling the canonical way. --- diff --git a/testcode/lib/clock-test.c b/testcode/lib/clock-test.c index 0267668aa..9d420a5b0 100644 --- a/testcode/lib/clock-test.c +++ b/testcode/lib/clock-test.c @@ -12,11 +12,6 @@ #ifdef __CC65__ #include #include - -static void exitfn(void) -{ - if (doesclrscrafterexit()) cgetc(); -} #endif /* #ifdef __CC65__ */ static void print_time(void) @@ -42,7 +37,9 @@ int main(int argc, char **argv) static struct timespec new_time; #ifdef __CC65__ - atexit(exitfn); + /* if DOS will automatically clear the screen after the program exits, wait for a keypress... */ + if (doesclrscrafterexit()) + atexit((void (*)(void))cgetc); #endif if (argc <= 1) {