]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
hwclock: initialize parser variables
authorKarel Zak <kzak@redhat.com>
Mon, 29 Apr 2024 13:21:20 +0000 (15:21 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 2 May 2024 08:56:26 +0000 (10:56 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/hwclock-parse-date.y

index 834d8af0c9c88be43ff0c4ec843ff4afdaea4141..0d996cc87e0f1dcb540e2c9da409b98d4661ea46 100644 (file)
@@ -1265,16 +1265,16 @@ int parse_date(struct timespec *result, char const *p,
        time_t Start;
        intmax_t Start_ns;
        struct tm const *tmp;
-       struct tm tm;
-       struct tm tm0;
-       parser_control pc;
-       struct timespec gettime_buffer;
+       struct tm tm = { 0 };
+       struct tm tm0 = { 0 };
+       parser_control pc = { 0 };
+       struct timespec gettime_buffer = { 0 };
        unsigned char c;
        int tz_was_altered = 0;
        char *tz0 = NULL;
        char tz0buf[TZBUFSIZE];
        int ok = 1;
-       struct timeval tv;
+       struct timeval tv = { 0 };
 
        if (! now) {
                gettimeofday (&tv, NULL);