From: Karel Zak Date: Wed, 2 Oct 2019 14:13:25 +0000 (+0200) Subject: scriptreplay: fix io data log use X-Git-Tag: v2.35-rc1~125 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fc176b0e2ff6b85a997ec89dc01caad399d87c10;p=thirdparty%2Futil-linux.git scriptreplay: fix io data log use Signed-off-by: Karel Zak --- diff --git a/term-utils/script-playutils.c b/term-utils/script-playutils.c index c620946da5..b08a4e25b8 100644 --- a/term-utils/script-playutils.c +++ b/term-utils/script-playutils.c @@ -40,7 +40,7 @@ struct replay_log { const char *filename; FILE *fp; - unsigned int noseek; /* do not seek in this log */ + unsigned int noseek : 1; /* do not seek in this log */ }; struct replay_step { @@ -169,6 +169,7 @@ static struct replay_log *replay_new_log(struct replay_setup *stp, log = &stp->logs[stp->nlogs]; stp->nlogs++; + memset(log, 0, sizeof(*log)); log->filename = filename; log->streams = streams; log->fp = f; @@ -371,7 +372,6 @@ static int replay_seek_log(struct replay_log *log, size_t move) { if (log->noseek) return 0; - DBG(LOG, ul_debug(" %s: seek ++ %zu", log->filename, move)); return fseek(log->fp, move, SEEK_CUR) == (off_t) -1 ? -errno : 0; }