summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2013-04-23 18:08:40 +0000
committerderaadt <deraadt@openbsd.org>2013-04-23 18:08:40 +0000
commit6be702bba05c1786667a15d945e6c24dd8cfa890 (patch)
tree63fda7e34d6351bf21311c82ce652f9fcbc9b847
parentuse xasprintf instead of a series of strlcats and strdup. ok djm (diff)
downloadwireguard-openbsd-6be702bba05c1786667a15d945e6c24dd8cfa890.tar.xz
wireguard-openbsd-6be702bba05c1786667a15d945e6c24dd8cfa890.zip
handle large ino_t; ok millert
-rw-r--r--bin/ls/print.c8
-rw-r--r--usr.bin/find/ls.c5
2 files changed, 8 insertions, 5 deletions
diff --git a/bin/ls/print.c b/bin/ls/print.c
index b87cbddbaf8..031ea80c60d 100644
--- a/bin/ls/print.c
+++ b/bin/ls/print.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print.c,v 1.28 2012/07/12 09:41:09 guenther Exp $ */
+/* $OpenBSD: print.c,v 1.29 2013/04/23 18:08:40 deraadt Exp $ */
/* $NetBSD: print.c,v 1.15 1996/12/11 03:25:39 thorpej Exp $ */
/*
@@ -90,7 +90,8 @@ printlong(DISPLAY *dp)
continue;
sp = p->fts_statp;
if (f_inode)
- (void)printf("%*u ", dp->s_inode, sp->st_ino);
+ (void)printf("%*llu ", dp->s_inode,
+ (unsigned long long)sp->st_ino);
if (f_size)
(void)printf("%*qd ",
dp->s_block, howmany(sp->st_blocks, blocksize));
@@ -220,7 +221,8 @@ printaname(FTSENT *p, u_long inodefield, u_long sizefield)
sp = p->fts_statp;
chcnt = 0;
if (f_inode)
- chcnt += printf("%*u ", (int)inodefield, sp->st_ino);
+ chcnt += printf("%*llu ", (int)inodefield,
+ (unsigned long long)sp->st_ino);
if (f_size)
chcnt += printf("%*qd ",
(int)sizefield, howmany(sp->st_blocks, blocksize));
diff --git a/usr.bin/find/ls.c b/usr.bin/find/ls.c
index d757ba07e63..66680561708 100644
--- a/usr.bin/find/ls.c
+++ b/usr.bin/find/ls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ls.c,v 1.13 2009/10/27 23:59:38 deraadt Exp $ */
+/* $OpenBSD: ls.c,v 1.14 2013/04/23 18:08:40 deraadt Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -58,7 +58,8 @@ printlong(char *name, char *accpath, struct stat *sb)
{
char modep[15];
- (void)printf("%6u %4lld ", sb->st_ino, (long long)sb->st_blocks);
+ (void)printf("%6llu %4lld ", (unsigned long long)sb->st_ino,
+ (long long)sb->st_blocks);
(void)strmode(sb->st_mode, modep);
(void)printf("%s %3u %-*.*s %-*.*s ", modep, sb->st_nlink,
NAME_WIDTH, UT_NAMESIZE, user_from_uid(sb->st_uid, 0),