mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Allow for printing out integer arrays.
This commit is contained in:
parent
5adee71e55
commit
2b4c0a3bc6
2 changed files with 16 additions and 4 deletions
|
|
@ -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 a new issue