diff options
author | Tobias Weingartner <weingart@cvs.openbsd.org> | 2004-02-29 12:14:06 +0000 |
---|---|---|
committer | Tobias Weingartner <weingart@cvs.openbsd.org> | 2004-02-29 12:14:06 +0000 |
commit | 9d8798e2530ab147c263c141db3f47a948360b95 (patch) | |
tree | 08c75456b6469e7cf1b4c7c258a235e8d993f891 /sys/kern | |
parent | 43adbb845addbdd4df996f1fb1c06ae80c9854b9 (diff) |
Check for negative numbers.
ok grange@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_sysctl.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index a49859fc5ca..6cfce5efb8c 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.103 2004/02/27 21:46:44 grange Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.104 2004/02/29 12:14:05 weingart Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -578,6 +578,8 @@ hw_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) return (0); if (perflevel > 100) perflevel = 100; + if (perflevel < 0) + perflevel = 0; return (cpu_setperf(perflevel)); default: return (EOPNOTSUPP); |