aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZach van Rijn <me@zv.io>2024-09-03 16:31:15 +0000
committerSam James <sam@gentoo.org>2024-09-22 05:30:42 +0100
commitf80b5effb263c13865a958d395ec65df0ad930a1 (patch)
treea0abce9a28de537f7d8bf569add781c9d3765545
parentfuzzer: fix unused setting on argc & argv (diff)
downloadpax-utils-f80b5effb263c13865a958d395ec65df0ad930a1.tar.gz
pax-utils-f80b5effb263c13865a958d395ec65df0ad930a1.tar.bz2
pax-utils-f80b5effb263c13865a958d395ec65df0ad930a1.zip
paxelf: use correct format string
On 32-bit platforms, mmap() larger than 2GB may fail. This patch ensures that the correct size is printed and provides parity with commit 90a0c6affc9b2fe9ebd6ba3cf3ee9fbcc1fc5835. Signed-off-by: Zach van Rijn <me@zv.io> Closes: https://github.com/gentoo/pax-utils/pull/18 Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r--paxelf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/paxelf.c b/paxelf.c
index 599d54f..795971a 100644
--- a/paxelf.c
+++ b/paxelf.c
@@ -684,7 +684,7 @@ elfobj *_readelf_fd(const char *filename, int fd, size_t len, int read_only)
buffer = mmap(0, len, PROT_READ | (read_only ? 0 : PROT_WRITE), (read_only ? MAP_PRIVATE : MAP_SHARED), fd, 0);
if (buffer == MAP_FAILED) {
- warn("mmap on '%s' of %li bytes failed :(", filename, (unsigned long)len);
+ warn("mmap on '%s' of %zu bytes failed :(", filename, len);
return NULL;
}