diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2006-03-17 17:12:37 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2006-03-17 17:12:37 +0000 |
commit | b84c49e4e5d6defbf97b28b89d719b0e10b4255f (patch) | |
tree | 620964d9e1522e90a5d1e5c9519208b78b1e4ac6 /bin | |
parent | 545662306a341986faab81d8a2adb54b559c6830 (diff) |
off-by-one; inspired by a netbsd coverity fix; ok deraadt@
Diffstat (limited to 'bin')
-rw-r--r-- | bin/csh/error.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/csh/error.c b/bin/csh/error.c index 12f73404ca6..0520505e6b7 100644 --- a/bin/csh/error.c +++ b/bin/csh/error.c @@ -1,4 +1,4 @@ -/* $OpenBSD: error.c,v 1.6 2003/06/11 21:09:50 deraadt Exp $ */ +/* $OpenBSD: error.c,v 1.7 2006/03/17 17:12:36 otto Exp $ */ /* $NetBSD: err.c,v 1.6 1995/03/21 09:02:47 cgd Exp $ */ /*- @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)err.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: error.c,v 1.6 2003/06/11 21:09:50 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: error.c,v 1.7 2006/03/17 17:12:36 otto Exp $"; #endif #endif /* not lint */ @@ -292,7 +292,7 @@ seterror(int id, ...) va_list va; va_start(va, id); - if (id < 0 || id > sizeof(errorlist) / sizeof(errorlist[0])) + if (id < 0 || id >= sizeof(errorlist) / sizeof(errorlist[0])) id = ERR_INVALID; vsnprintf(berr, sizeof(berr), errorlist[id], va); va_end(va); |