Allow for printing out integer arrays.

This commit is contained in:
Poul-Henning Kamp 1998-11-08 19:27:43 +00:00
parent 5adee71e55
commit 2b4c0a3bc6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=41019
2 changed files with 16 additions and 4 deletions

View File

@ -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':

View File

@ -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':