diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2017-06-13 06:16:32 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2017-06-13 06:16:32 +0000 |
commit | a82e02c80d52e048fec051cdb9e7b41cfc9d7da7 (patch) | |
tree | 08a9482c5765bfa3d1f0e83e8871817cec8b1ee5 /sys/kern | |
parent | f1ccfcd0036290cac263e88e32e5abd6979dad9a (diff) |
use size_t for the size of things in memory, not int.
this tweaks the len argument to sysctl_rdstring, sysctl_struct, and
sysctl_rdstruct.
there's probably more to fix.
ok millert@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_sysctl.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 218cc683e8d..13024bf6ecb 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.326 2017/05/06 18:18:11 bluhm Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.327 2017/06/13 06:16:31 dlg Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -977,7 +977,8 @@ sysctl__string(void *oldp, size_t *oldlenp, void *newp, size_t newlen, int sysctl_rdstring(void *oldp, size_t *oldlenp, void *newp, const char *str) { - int len, error = 0; + size_t len; + int error = 0; len = strlen(str) + 1; if (oldp && *oldlenp < len) @@ -996,7 +997,7 @@ sysctl_rdstring(void *oldp, size_t *oldlenp, void *newp, const char *str) */ int sysctl_struct(void *oldp, size_t *oldlenp, void *newp, size_t newlen, void *sp, - int len) + size_t len) { int error = 0; @@ -1019,7 +1020,7 @@ sysctl_struct(void *oldp, size_t *oldlenp, void *newp, size_t newlen, void *sp, */ int sysctl_rdstruct(void *oldp, size_t *oldlenp, void *newp, const void *sp, - int len) + size_t len) { int error = 0; |