summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2009-11-11 16:15:07 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2009-11-11 16:15:07 +0000
commit468e1466ec8d91ae05e30e48dc376798c69391b3 (patch)
treea009d8d46267c2df294634ec860fe229ff8a3b7a
parent8ee5c2d8be6e5d9f68d15addc9137af7a16b5db6 (diff)
incorrect range check, > vs >=, on the error list, spotted by parfait
ok otto jsg
-rw-r--r--bin/csh/error.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/csh/error.c b/bin/csh/error.c
index 3c6239257e5..fe21b4935a0 100644
--- a/bin/csh/error.c
+++ b/bin/csh/error.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: error.c,v 1.9 2009/10/27 23:59:21 deraadt Exp $ */
+/* $OpenBSD: error.c,v 1.10 2009/11/11 16:15:06 deraadt Exp $ */
/* $NetBSD: err.c,v 1.6 1995/03/21 09:02:47 cgd Exp $ */
/*-
@@ -323,7 +323,7 @@ stderror(int id, ...)
if ((flags & ERR_OLD) && seterr == NULL)
return;
- if (id < 0 || id > sizeof(errorlist) / sizeof(errorlist[0]))
+ if (id < 0 || id >= sizeof(errorlist) / sizeof(errorlist[0]))
id = ERR_INVALID;
(void) fflush(cshout);