From 7571ef42c6217702c6fcbeca2427f58fd7fe5b3e Mon Sep 17 00:00:00 2001 From: apio Date: Mon, 6 Feb 2023 23:18:05 +0100 Subject: [PATCH] fix: Cast time_t to a known type for snprintf() --- src/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.c b/src/util.c index 08b8c31..822ec43 100644 --- a/src/util.c +++ b/src/util.c @@ -250,7 +250,7 @@ void minitar_construct_header_from_metadata(struct tar_header* hdr, const struct // snprintf will write the null terminator past the size field. We don't care, as we will overwrite that zero later. snprintf(hdr->size, 13, "%.12zo", metadata->size); // Same here. - snprintf(hdr->mtime, 13, "%.12lo", metadata->mtime); + snprintf(hdr->mtime, 13, "%.12llo", (long long)metadata->mtime); switch (metadata->type) {