From: Karel Zak Date: Mon, 14 Dec 2020 14:56:55 +0000 (+0100) Subject: scriptlive: fix compiler warnings [-Wmaybe-uninitialized] X-Git-Tag: v2.37-rc1~218 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf918bd3ac9ba69e1a9149093ca335696d95d432;p=thirdparty%2Futil-linux.git scriptlive: fix compiler warnings [-Wmaybe-uninitialized] 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 --- diff --git a/term-utils/scriptlive.c b/term-utils/scriptlive.c index ac75588cd5..37f092c1ff 100644 --- a/term-utils/scriptlive.c +++ b/term-utils/scriptlive.c @@ -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);