summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2020-03-06 12:52:57 -0500
committerJakob Kaivo <jkk@ung.org>2020-03-06 12:52:57 -0500
commitb95f33758bbbf89a8d88110945663636ab465d96 (patch)
treec33607d3f249c41acb5cc39425f4291a7b406ce4
parentaaee10ba70130484d23f7c55d4a487b949f6c076 (diff)
use uintmax_t for file sizes
-rw-r--r--ls.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ls.c b/ls.c
index 1863a3c..7ec08ae 100644
--- a/ls.c
+++ b/ls.c
@@ -24,6 +24,7 @@
#define _XOPEN_SOURCE 700
#include <stdio.h>
+#include <stdint.h>
#include <sys/stat.h>
#include <unistd.h>
#include <dirent.h>
@@ -88,7 +89,7 @@ static int columns = 80;
struct ls_entry {
char name[PATH_MAX];
- off_t size;
+ uintmax_t size;
ino_t inode;
time_t time;
uid_t uid;
@@ -226,7 +227,7 @@ static int ls_other(struct ls_entry *current, int cpos)
printf("%-*s ", longestgroup, current->group);
}
- printf("%*u ", sizelen, (unsigned int)current->size);
+ printf("%*ju ", sizelen, (uintmax_t)current->size);
printf("%s %s", time, current->name);
if (links != LLONG && current->type == 'l')