]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Fix a format string build failure on x32.
authorAdam Borowski <kilobyte@angband.pl>
Sun, 15 Oct 2017 19:09:03 +0000 (19:09 +0000)
committerStéphane Graber <stgraber@ubuntu.com>
Thu, 19 Oct 2017 01:22:30 +0000 (21:22 -0400)
Both of struct timespec fields are 64-bit on any new architecture, even
32-bit ones.

Signed-off-by: Adam Borowski <kilobyte@angband.pl>
src/lxc/log.c

index cdff1750624536f9569844974e0754fcefa770c3..2668015e782fb506227e6d846fcbedc8080d8f4e 100644 (file)
@@ -155,7 +155,7 @@ int lxc_unix_epoch_to_utc(char *buf, size_t bufsize, const struct timespec *time
        seconds = (time->tv_sec - d_in_s - h_in_s - (minutes * 60));
 
        /* Make string from nanoseconds. */
-       ret = snprintf(nanosec, LXC_NUMSTRLEN64, "%ld", time->tv_nsec);
+       ret = snprintf(nanosec, LXC_NUMSTRLEN64, "%"PRId64, (int64_t)time->tv_nsec);
        if (ret < 0 || ret >= LXC_NUMSTRLEN64)
                return -1;