From: Masatake YAMATO Date: Thu, 10 Feb 2022 07:06:42 +0000 (+0900) Subject: lsfd: fix the way to print stat.st_size X-Git-Tag: v2.38-rc2~28^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e438aee7d10ebf3c50360c90a324b40df4906a93;p=thirdparty%2Futil-linux.git lsfd: fix the way to print stat.st_size The format string was wrong and a proper cast operator was missed for printing the member. See the example in stat(2). Signed-off-by: Masatake YAMATO --- diff --git a/misc-utils/lsfd-file.c b/misc-utils/lsfd-file.c index 2507b38404..9c320e9493 100644 --- a/misc-utils/lsfd-file.c +++ b/misc-utils/lsfd-file.c @@ -289,7 +289,7 @@ static bool file_fill_column(struct proc *proc, xasprintf(&str, "%d", (int)file->stat.st_uid); break; case COL_SIZE: - xasprintf(&str, "%ju", file->stat.st_size); + xasprintf(&str, "%jd", (intmax_t)file->stat.st_size); break; case COL_NLINK: xasprintf(&str, "%ju", (unsigned long int)file->stat.st_nlink);