summaryrefslogtreecommitdiffstats
path: root/toolbox
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2010-06-25 09:08:05 -0700
committerKenny Root <kroot@google.com>2010-06-25 09:08:05 -0700
commiteb42170e6c8b70f11dca9965785aa04a80290c72 (patch)
tree3ea0a62fa33ef2bc53a7fd27dd3ea1caeba434fe /toolbox
parent93b0cb40c18cae594c931677be2b9214420610b7 (diff)
downloadsystem_core-eb42170e6c8b70f11dca9965785aa04a80290c72.zip
system_core-eb42170e6c8b70f11dca9965785aa04a80290c72.tar.gz
system_core-eb42170e6c8b70f11dca9965785aa04a80290c72.tar.bz2
Display file sizes larger than 2GB correctly
File size was cast to a signed integer which displayed files over 2GB as negative sizes on devices. Use a long long for printing instead which matches the stat struct. Change-Id: I0ec07f33716bb4c2e5d120633ed435f637238f46
Diffstat (limited to 'toolbox')
-rw-r--r--toolbox/ls.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/toolbox/ls.c b/toolbox/ls.c
index f340a83..8799514 100644
--- a/toolbox/ls.c
+++ b/toolbox/ls.c
@@ -173,8 +173,8 @@ static int listfile_long(const char *path, int flags)
date, name);
break;
case S_IFREG:
- printf("%s %-8s %-8s %8d %s %s\n",
- mode, user, group, (int) s.st_size, date, name);
+ printf("%s %-8s %-8s %8lld %s %s\n",
+ mode, user, group, s.st_size, date, name);
break;
case S_IFLNK: {
char linkto[256];