diff options
author | phk <phk@FreeBSD.org> | 1998-11-08 19:27:43 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1998-11-08 19:27:43 +0000 |
commit | 153e666c16eb6cb1b2aaab90fde667a2ffdacbff (patch) | |
tree | eaa42277178eaecd7e2c3cf34025184ed884f2b2 /sbin/sysctl | |
parent | b75b623eaad2308755376753fbb2c2235baa08b9 (diff) | |
download | FreeBSD-src-153e666c16eb6cb1b2aaab90fde667a2ffdacbff.zip FreeBSD-src-153e666c16eb6cb1b2aaab90fde667a2ffdacbff.tar.gz |
Allow for printing out integer arrays.
Diffstat (limited to 'sbin/sysctl')
-rw-r--r-- | sbin/sysctl/sysctl.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index 14247a0..94e630e 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "@(#)from: sysctl.c 8.1 (Berkeley) 6/6/93"; #endif static const char rcsid[] = - "$Id: sysctl.c,v 1.17 1998/06/29 17:54:29 bde Exp $"; + "$Id: sysctl.c,v 1.18 1998/08/25 07:38:19 dfr Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -389,7 +389,13 @@ show_var(int *oid, int nlen) case 'I': if (!nflag) printf("%s: ", name); - printf("%d", *(int *)p); + val = ""; + while (len >= sizeof(int)) { + printf("%s%d", val, *(int *)p); + val = " "; + len -= sizeof (int); + p += sizeof (int); + } return (0); case 'L': |