summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAriadne Conill <ariadne@dereferenced.org>2021-12-14 10:55:27 -0600
committerTimo Teräs <timo.teras@iki.fi>2021-12-14 18:49:11 +0000
commit5bd3b1e3fc407f1ec558ebf4dfc147842191f893 (patch)
treeefe1f75dd450e77679319af817560e29f7ee2d85
parent6df9f0ed59e051c8a9d96e1a33e4a9880f761969 (diff)
downloadapk-tools-5bd3b1e3fc407f1ec558ebf4dfc147842191f893.tar.gz
apk-tools-5bd3b1e3fc407f1ec558ebf4dfc147842191f893.tar.bz2
apk-tools-5bd3b1e3fc407f1ec558ebf4dfc147842191f893.tar.xz
apk-tools-5bd3b1e3fc407f1ec558ebf4dfc147842191f893.zip
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
-rw-r--r--src/fs_uvol.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fs_uvol.c b/src/fs_uvol.c
index f2ba3f1..ec6fc35 100644
--- a/src/fs_uvol.c
+++ b/src/fs_uvol.c
@@ -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;