Allow for printing out integer arrays.
This commit is contained in:
parent
5adee71e55
commit
2b4c0a3bc6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=41019
@ -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':
|
||||
|
@ -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':
|
||||
|
Loading…
Reference in New Issue
Block a user