Skip to content

Commit

Permalink
Fix displaying of large file sizes.
Browse files Browse the repository at this point in the history
The most generic way is to use `intmax_t`
because we dont't know what is the "parent" type of `off_t`.
This fixes netblue30#5982 .
  • Loading branch information
chestnykh committed Nov 13, 2023
1 parent 6442450 commit e5cdc27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/firejail/ls.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e5cdc27

Please sign in to comment.