diff options
author | phk <phk@FreeBSD.org> | 2000-07-11 21:59:54 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2000-07-11 21:59:54 +0000 |
commit | c8c04452402a28eabd1ed8a1a06e0a14ac3d22c6 (patch) | |
tree | 27757b9c974e664d65196fccf2eabf430b116e25 /sbin | |
parent | a1d52bdfdc8b4fd8540edf1c6d2d79da59c6c8ea (diff) | |
download | FreeBSD-src-c8c04452402a28eabd1ed8a1a06e0a14ac3d22c6.zip FreeBSD-src-c8c04452402a28eabd1ed8a1a06e0a14ac3d22c6.tar.gz |
Array of long support.
Submitted by: Ian Dowse <iedowse@maths.tcd.ie>
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/sysctl/sysctl.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index 8ae3cbd..ee7ee72 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -415,10 +415,16 @@ show_var(int *oid, int nlen) if (!nflag) printf("%s: ", name); fmt++; - if(*fmt == 'U') - printf("%lu", *(unsigned long *)p); - else - printf("%ld", *(long *)p); + val = ""; + while (len >= sizeof(long)) { + if(*fmt == 'U') + printf("%s%lu", val, *(unsigned long *)p); + else + printf("%s%ld", val, *(long *)p); + val = " "; + len -= sizeof (int); + p += sizeof (int); + } return (0); case 'P': |