summaryrefslogtreecommitdiffstats
path: root/term-utils/script.c
diff options
context:
space:
mode:
authorRuediger Meier2016-02-09 18:08:56 +0100
committerRuediger Meier2016-02-11 13:39:56 +0100
commit7231fb2a5b0b0ebf2be047a23a11ca43e786861b (patch)
tree2467d1d110e0699a65a36636e173a132e1233751 /term-utils/script.c
parentinclude: add missing includes (diff)
downloadkernel-qcow2-util-linux-7231fb2a5b0b0ebf2be047a23a11ca43e786861b.tar.gz
kernel-qcow2-util-linux-7231fb2a5b0b0ebf2be047a23a11ca43e786861b.tar.xz
kernel-qcow2-util-linux-7231fb2a5b0b0ebf2be047a23a11ca43e786861b.zip
misc: fix some printf format strings
Fix the warnings below for OSX clang and add a few more casts for timeval: lib/at.c:131:27: warning: format specifies type 'intmax_t' (aka 'long') but the argument has type 'off_t' (aka 'long long') [-Wformat] printf("%16jd bytes ", st.st_size); ~~~~~ ^~~~~~~~~~ lib/strutils.c:522:52: warning: format specifies type 'intmax_t' (aka 'long') but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat] snprintf(buf, sizeof(buf), "%d%s%jd%s", dec, dp, frac, suffix); ~~~ ^~~~ lib/sysfs.c:468:42: warning: format specifies type 'uintmax_t' (aka 'unsigned long') but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat] len = snprintf(buf, sizeof(buf), "%ju", num); ~~~ ^~~ libuuid/src/gen_uuid.c:316:34: warning: format specifies type 'unsigned long' but the argument has type '__darwin_suseconds_t' (aka 'int') [-Wformat] clock_seq, last.tv_sec, last.tv_usec, adjustment); ^~~~~~~~~~~~ Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'term-utils/script.c')
-rw-r--r--term-utils/script.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/term-utils/script.c b/term-utils/script.c
index fcb583584..23ca89cdc 100644
--- a/term-utils/script.c
+++ b/term-utils/script.c
@@ -249,7 +249,8 @@ static void write_output(struct script_control *ctl, char *obuf,
gettime_monotonic(&now);
timersub(&now, &ctl->oldtime, &delta);
- fprintf(ctl->timingfp, "%ld.%06ld %zd\n", delta.tv_sec, delta.tv_usec, bytes);
+ fprintf(ctl->timingfp, "%ld.%06ld %zd\n",
+ (long)delta.tv_sec, (long)delta.tv_usec, bytes);
if (ctl->flush)
fflush(ctl->timingfp);
ctl->oldtime = now;