]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
script: be pedantic and use "%"SCNi64
authorKarel Zak <kzak@redhat.com>
Fri, 16 Oct 2015 09:48:47 +0000 (11:48 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 16 Oct 2015 09:48:47 +0000 (11:48 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
term-utils/script.c

index 67ed8b9ca38e31fafbf042e515db5bf6a5be6c6c..b6227c08ed32b86c95988302afd16c1e0fe2a7a5 100644 (file)
@@ -62,6 +62,7 @@
 #include <poll.h>
 #include <sys/signalfd.h>
 #include <assert.h>
+#include <inttypes.h>
 
 #include "closestream.h"
 #include "nls.h"
@@ -143,7 +144,7 @@ static inline time_t script_time(time_t *t)
        const char *str = getenv("SCRIPT_TEST_SECOND_SINCE_EPOCH");
        int64_t sec;
 
-       if (!str || sscanf(str, "%jd", &sec) != 1)
+       if (!str || sscanf(str, "%"SCNi64, &sec) != 1)
                return time(t);
        if (t)
                *t = (time_t)sec;