From: Adam Borowski Date: Sun, 15 Oct 2017 19:09:03 +0000 (+0000) Subject: Fix a format string build failure on x32. X-Git-Tag: lxc-3.0.0.beta1~212^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=291f64ac27813451f4045e512a8f2c3e425af254;p=thirdparty%2Flxc.git Fix a format string build failure on x32. Both of struct timespec fields are 64-bit on any new architecture, even 32-bit ones. Signed-off-by: Adam Borowski --- diff --git a/src/lxc/log.c b/src/lxc/log.c index 6ca315bd6..c1c67d22e 100644 --- a/src/lxc/log.c +++ b/src/lxc/log.c @@ -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;