]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
scriptreplay: improve error message
authorSami Kerola <kerolasa@iki.fi>
Sun, 1 May 2016 22:56:04 +0000 (23:56 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 5 May 2016 09:46:54 +0000 (11:46 +0200)
Use human numbering for lines - that is start counting from 1.  And tell in
error message what the number means.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
term-utils/scriptreplay.c

index b4549ef16edd6633ef565716240cdd5f78547974..51985cda8fb98173091b10e8d83df4cea4558aa5 100644 (file)
@@ -211,7 +211,7 @@ main(int argc, char *argv[])
        /* ignore the first typescript line */
        while((c = fgetc(sfile)) != EOF && c != '\n');
 
-       for(line = 0; ; line++) {
+       for(line = 1; ; line++) {
                double delay;
                size_t blk;
                char nl;
@@ -223,7 +223,7 @@ main(int argc, char *argv[])
                                err(EXIT_FAILURE,
                                        _("failed to read timing file %s"), tname);
                        errx(EXIT_FAILURE,
-                               _("timings file %s: %lu: unexpected format"),
+                               _("timing file %s: line %lu: unexpected format"),
                                tname, line);
                }
                delay /= divi;