From fe7845b5f014aa9f063876019bd5bae17a63c194 Mon Sep 17 00:00:00 2001 From: Christian Groessler Date: Tue, 25 Sep 2018 20:26:25 +0200 Subject: [PATCH] clock-test.c: remove "static" optimization --- testcode/lib/clock-test.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/testcode/lib/clock-test.c b/testcode/lib/clock-test.c index 9d420a5b0..e3115d2f1 100644 --- a/testcode/lib/clock-test.c +++ b/testcode/lib/clock-test.c @@ -31,10 +31,10 @@ static void print_time(void) int main(int argc, char **argv) { - static char c; - static int s; - static struct tm cur_time; - static struct timespec new_time; + char c = 0; + int s; + struct tm cur_time; + struct timespec new_time; #ifdef __CC65__ /* if DOS will automatically clear the screen after the program exits, wait for a keypress... */ @@ -52,6 +52,7 @@ int main(int argc, char **argv) return 1; } + memset(&cur_time, 0, sizeof(cur_time)); s = sscanf(*(argv + 2), "%d-%d-%d-%d-%d-%d", &cur_time.tm_mday, &cur_time.tm_mon, &cur_time.tm_year, &cur_time.tm_hour, &cur_time.tm_min, &cur_time.tm_sec); if (s != 6 || cur_time.tm_year > 99 /* other input values aren't being verified... */) { printf("invalid time/date format\n"); -- 2.39.5