diff options
author | Rob Landley <rob@landley.net> | 2012-06-13 23:58:21 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2012-06-13 23:58:21 -0500 |
commit | e28e4b95081671998827fe2edbd621a4a3c47bd9 (patch) | |
tree | 6b15cedbd292b2ce1c7c64497d290899c62aa69e /toys | |
parent | 918de13c86a5baa3bebe09ad12f092a0479d48f6 (diff) | |
download | toybox-e28e4b95081671998827fe2edbd621a4a3c47bd9.tar.gz |
Fix an embarassing bug causing ls -l to segfault on 32 bit targets.
Diffstat (limited to 'toys')
-rw-r--r-- | toys/ls.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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) { |