Unverified Commit d9d811bf by Adam Borowski Committed by Stéphane Graber

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: 's avatarAdam Borowski <kilobyte@angband.pl>
parent 50d5fde1
...@@ -222,7 +222,7 @@ int lxc_unix_epoch_to_utc(char *buf, size_t bufsize, const struct timespec *time ...@@ -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)); seconds = (time->tv_sec - d_in_s - h_in_s - (minutes * 60));
/* Make string from nanoseconds. */ /* 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) if (ret < 0 || ret >= LXC_NUMSTRLEN64)
return -1; return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment