]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
scriptlive: fix compiler warnings [-Wmaybe-uninitialized]
authorKarel Zak <kzak@redhat.com>
Mon, 14 Dec 2020 14:56:55 +0000 (15:56 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 14 Dec 2020 15:03:03 +0000 (16:03 +0100)
term-utils/scriptlive.c: In function 'process_next_step':
term-utils/scriptlive.c:125:4: warning: 'now.tv_usec' may be used uninitialized in this function [-Wmaybe-uninitialized]
term-utils/scriptlive.c:122:19: note: 'now.tv_usec' was declared here
term-utils/scriptlive.c:125:4: warning: 'now.tv_sec' may be used uninitialized in this function [-Wmaybe-uninitialized]
term-utils/scriptlive.c:122:19: note: 'now.tv_sec' was declared here

Signed-off-by: Karel Zak <kzak@redhat.com>
term-utils/scriptlive.c

index ac75588cd5eeeb35349db46f5f02bf566c69ec2b..37f092c1ffbf6da407f1c586fa8c3c247fa5c103 100644 (file)
@@ -119,7 +119,7 @@ static int process_next_step(struct scriptlive *ss)
                delay = replay_step_get_delay(ss->step);
                if (timerisset(delay)) {
                        /* wait until now+delay in mainloop */
-                       struct timeval now, target;
+                       struct timeval now = { 0 }, target = { 0 };
 
                        gettime_monotonic(&now);
                        timeradd(&now, delay, &target);