]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
cript: always use decimal point numbers in logs
authorKarel Zak <kzak@redhat.com>
Mon, 29 Jul 2019 10:43:06 +0000 (12:43 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 8 Oct 2019 11:11:54 +0000 (13:11 +0200)
The new header/info lines in log uses 0, but it's unexpected by
scriptreplay as there was always number formatted by %f.

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

index 493e79c0fdbddd4381e5712bbc5030e3ac78fa36..17a747394d9f7e64813ce14e0b479a2f56d91122 100644 (file)
@@ -555,9 +555,9 @@ static uint64_t log_info(struct script_control *ctl, const char *name, const cha
        }
 
        if (*msg)
-               sz = fprintf(log->fp, "H 0 %s %s\n", name, msg);
+               sz = fprintf(log->fp, "H %f %s %s\n", 0.0, name, msg);
        else
-               sz = fprintf(log->fp, "H 0 %s\n", name);
+               sz = fprintf(log->fp, "H %f %s\n", 0.0, name);
 
        return sz > 0 ? sz : 0;
 }