]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
scriptreplay: make sure timing file specified
authorKarel Zak <kzak@redhat.com>
Wed, 26 Jun 2019 10:27:34 +0000 (12:27 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 8 Oct 2019 11:11:53 +0000 (13:11 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
term-utils/scriptreplay.c

index 57ba679268b6d194d1e796c9e7305c58986b9f3b..952b2c8455fef2daf7db331f71f29154a9bc925e 100644 (file)
@@ -602,7 +602,9 @@ main(int argc, char *argv[])
        if (maxdelay < 0)
                maxdelay = 0;
 
-       if (replay_set_timing_file(&setup, log_tm) != 0)
+       if (!log_tm)
+               errx(EXIT_FAILURE, _("timing file not specified"));
+       else if (replay_set_timing_file(&setup, log_tm) != 0)
                err(EXIT_FAILURE, _("cannot open %s"), log_tm);
 
        if (log_out && replay_associate_log(&setup, "O", log_out) != 0)