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
This commit is contained in:
Kenny Root 2010-06-25 09:08:05 -07:00
parent 93b0cb40c1
commit eb42170e6c

View file

@ -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];