From 1203e9e0c4d7a3c90736a78b53079e9d584fc084 Mon Sep 17 00:00:00 2001 From: Christian Groessler Date: Tue, 25 Sep 2018 14:35:52 +0200 Subject: [PATCH] clock-test.c: do doesclrscrafterexit() handling the canonical way. --- testcode/lib/clock-test.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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) { -- 2.39.5