fix: Cast time_t to a known type for snprintf()

This commit is contained in:
apio 2023-02-06 23:18:05 +01:00
parent 88d6fbffb7
commit 7571ef42c6
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -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 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); snprintf(hdr->size, 13, "%.12zo", metadata->size);
// Same here. // Same here.
snprintf(hdr->mtime, 13, "%.12lo", metadata->mtime); snprintf(hdr->mtime, 13, "%.12llo", (long long)metadata->mtime);
switch (metadata->type) switch (metadata->type)
{ {