diff options
| author | Jim Pirzyk <pirzyk@FreeBSD.org> | 2001-07-18 15:36:45 +0000 |
|---|---|---|
| committer | Jim Pirzyk <pirzyk@FreeBSD.org> | 2001-07-18 15:36:45 +0000 |
| commit | cde4f2eb70767b00a5ba02ca1d30b23121231989 (patch) | |
| tree | 30d83febd911435915f1b54be2363b5771d1ae40 /sbin/sysctl/sysctl.c | |
| parent | 6ebb21dd98291abb6d0407d471b9d8d36bc0ebda (diff) | |
Notes
Diffstat (limited to 'sbin/sysctl/sysctl.c')
| -rw-r--r-- | sbin/sysctl/sysctl.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index 23d5b8c9630f..444c1023dda7 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -121,7 +121,11 @@ parse(char *string) { int len, i, j; void *newval = 0; - int intval, newsize = 0; + int intval; + unsigned int uintval; + long longval; + unsigned long ulongval; + size_t newsize = 0; quad_t quadval; int mib[CTL_MAXNAME]; char *cp, *bufp, buf[BUFSIZ]; @@ -171,6 +175,20 @@ parse(char *string) newval = &intval; newsize = sizeof(intval); break; + case CTLTYPE_UINT: + uintval = (int) strtoul(newval, NULL, 0); + newval = &uintval; + newsize = sizeof uintval; + break; + case CTLTYPE_LONG: + longval = strtol(newval, NULL, 0); + newval = &longval; + newsize = sizeof longval; + break; + case CTLTYPE_ULONG: + ulongval = strtoul(newval, NULL, 0); + newval = &ulongval; + newsize = sizeof ulongval; break; case CTLTYPE_STRING: break; |
