From e5cdc275347af7755ae17279a603680843ba2877 Mon Sep 17 00:00:00 2001 From: Dmitry Chestnykh Date: Mon, 13 Nov 2023 14:30:09 +0300 Subject: [PATCH] Fix displaying of large file sizes. The most generic way is to use `intmax_t` because we dont't know what is the "parent" type of `off_t`. This fixes https://github.com/netblue30/firejail/issues/5982 . --- src/firejail/ls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/firejail/ls.c b/src/firejail/ls.c index f2ab1c1882c..6dc4904fce7 100644 --- a/src/firejail/ls.c +++ b/src/firejail/ls.c @@ -154,7 +154,7 @@ static void print_file_or_dir(const char *path, const char *fname) { // file size char *sz; - if (asprintf(&sz, "%d", (int) s.st_size) == -1) + if (asprintf(&sz, "%jd", (intmax_t) s.st_size) == -1) errExit("asprintf"); // file name