uvol: cast size data to intmax_t

this ensures the %ju format parameter is always passed an integer that is
appropriately sized, e.g. on mac where off_t is normally 32-bit.

ref #10794
cute-signatures
Ariadne Conill 2021-12-14 10:55:27 -06:00 committed by Timo Teräs
parent 6df9f0ed59
commit 5bd3b1e3fc
1 changed files with 1 additions and 1 deletions

View File

@ -110,7 +110,7 @@ static int uvol_file_extract(struct apk_ctx *ac, const struct apk_file_info *fi,
uvol_name = strrchr(fi->name, '/');
uvol_name = uvol_name ? uvol_name + 1 : fi->name;
snprintf(size, sizeof size, "%ju", fi->size);
snprintf(size, sizeof size, "%ju", (intmax_t) fi->size);
r = uvol_run(ac, "create", uvol_name, size, "ro");
if (r != 0) return r;