]> git.proxmox.com Git - mirror_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:06 +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 a99b4c8f04c57e4a0ba1429ec316e46f9d6f3c58..16b79c09d174e8a3253f804af5195e3e0ed85c76 100644 (file)
@@ -222,7 +222,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;