From: Tobias Stoeckmann Date: Sat, 18 Apr 2026 19:14:24 +0000 (+0200) Subject: hexdump: Cast %ll argument to long long X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd6fcc151583a731acf3b26f0d4dfbe5714cc916;p=thirdparty%2Futil-linux.git hexdump: Cast %ll argument to long long Cast off_t for F_ADDRESS to long long. In most cases, this should be actually unsigned long long due to %llx or %llo, but since %lld is also available and off_t is signed, keep it at that. In theory, this might fix very intelligent static analysers which notice that off_t is long int but %ll expects long long, but in reality, this fixes 32 bit off_t builds. Without this, wrong addresses are shown. Signed-off-by: Tobias Stoeckmann --- diff --git a/text-utils/hexdump-display.c b/text-utils/hexdump-display.c index d6422d24c..bff827db8 100644 --- a/text-utils/hexdump-display.c +++ b/text-utils/hexdump-display.c @@ -277,7 +277,7 @@ print(struct hexdump_pr *pr, unsigned char *bp) { switch(pr->flags) { case F_ADDRESS: - printf(pr->fmt, address); + printf(pr->fmt, (long long) address); break; case F_BPAD: printf(pr->fmt, "");