aboutsummaryrefslogtreecommitdiff
path: root/toys/ls.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2012-06-13 23:58:21 -0500
committerRob Landley <rob@landley.net>2012-06-13 23:58:21 -0500
commite28e4b95081671998827fe2edbd621a4a3c47bd9 (patch)
tree6b15cedbd292b2ce1c7c64497d290899c62aa69e /toys/ls.c
parent918de13c86a5baa3bebe09ad12f092a0479d48f6 (diff)
downloadtoybox-e28e4b95081671998827fe2edbd621a4a3c47bd9.tar.gz
Fix an embarassing bug causing ls -l to segfault on 32 bit targets.
Diffstat (limited to 'toys/ls.c')
-rw-r--r--toys/ls.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/toys/ls.c b/toys/ls.c
index 6c770a6b..6d0050fd 100644
--- a/toys/ls.c
+++ b/toys/ls.c
@@ -407,8 +407,10 @@ static void listfiles(int dirfd, struct dirtree *indir)
} else usr = getusername(st->st_uid);
}
- xprintf("%s% *d %s%s%s%s% *d %s ", perm, totals[2]+1, st->st_nlink,
- usr, upad, grp, grpad, totals[5]+1, st->st_size, thyme);
+ // Coerce the st types into something we know we can print.
+ xprintf("%s% *ld %s%s%s%s% *"PRId64" %s ", perm, totals[2]+1,
+ (long)st->st_nlink, usr, upad, grp, grpad, totals[5]+1,
+ (int64_t)st->st_size, thyme);
}
if (flags & FLAG_q) {