summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2003-01-15 23:41:57 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2003-01-15 23:41:57 +0000
commitcd268f8fe5443e1de742d9a3a1aa5ad18dce9154 (patch)
tree2da802a6ebf599f3aaa5104e5edf56ad6c3d6205
parent9ccb3490628704743c77010dda39973574565d44 (diff)
Fix two minor nits; deraadt@ OK
o Avoid taking the address of an array when we just want a pointer o Use &array[1] not array + 1
-rw-r--r--sys/kern/kern_sysctl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index a363787c4c2..49b128dec3a 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sysctl.c,v 1.77 2003/01/13 06:04:16 art Exp $ */
+/* $OpenBSD: kern_sysctl.c,v 1.78 2003/01/15 23:41:56 millert Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
@@ -143,7 +143,7 @@ sys___sysctl(p, v, retval)
*/
if (SCARG(uap, namelen) > CTL_MAXNAME || SCARG(uap, namelen) < 2)
return (EINVAL);
- error = copyin(SCARG(uap, name), &name,
+ error = copyin(SCARG(uap, name), name,
SCARG(uap, namelen) * sizeof(int));
if (error)
return (error);
@@ -202,7 +202,7 @@ sys___sysctl(p, v, retval)
}
savelen = oldlen;
}
- error = (*fn)(name + 1, SCARG(uap, namelen) - 1, SCARG(uap, old),
+ error = (*fn)(&name[1], SCARG(uap, namelen) - 1, SCARG(uap, old),
&oldlen, SCARG(uap, new), SCARG(uap, newlen), p);
if (SCARG(uap, old) != NULL) {
if (dolock)