diff options
author | Matthew Dempsky <matthew@cvs.openbsd.org> | 2012-08-30 20:11:33 +0000 |
---|---|---|
committer | Matthew Dempsky <matthew@cvs.openbsd.org> | 2012-08-30 20:11:33 +0000 |
commit | 19977425d47c02a035a26e4f89975bbcfbc142cb (patch) | |
tree | 114920a9d83f94e3b5cbeb589d58cdeaea184b0b /sys/kern | |
parent | a38cc505a83e2dee03f25dd3b1f21242d7eb2456 (diff) |
Remove a useless test for "elem_count < 0", which can never be true
because elem_count has an unsigned type (size_t).
Noted by Brad/Clang; no binary change on amd64 using GCC either.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_sysctl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 5e516070140..c9d14db068a 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.226 2012/06/02 05:44:27 guenther Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.227 2012/08/30 20:11:32 matthew Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -1246,7 +1246,7 @@ sysctl_file2(int *name, u_int namelen, char *where, size_t *sizep, elem_count = name[3]; outsize = MIN(sizeof(*kf), elem_size); - if (elem_size < 1 || elem_count < 0) + if (elem_size < 1) return (EINVAL); kf = malloc(sizeof(*kf), M_TEMP, M_WAITOK); |