summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2003-09-19 03:18:53 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2003-09-19 03:18:53 +0000
commit4487de59333f79dd68bffaf14a4f6bd55e1ffd87 (patch)
tree4731f79bc0d0bf5f86401dea033e2f24c7d3a851
parent7dcce979c686a67d06194006ad23a31f65f01a14 (diff)
When sanity checking signal numbers, error out on signal >= NSIG,
not > NSIG. This makes cvs give a nice error message for "kill -NSIG 666" instead of EINVAL. From aaron@monkey.org.
-rw-r--r--bin/csh/proc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/csh/proc.c b/bin/csh/proc.c
index 475f23f8a20..b3882a9f0de 100644
--- a/bin/csh/proc.c
+++ b/bin/csh/proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: proc.c,v 1.19 2003/06/11 21:09:50 deraadt Exp $ */
+/* $OpenBSD: proc.c,v 1.20 2003/09/19 03:18:52 millert Exp $ */
/* $NetBSD: proc.c,v 1.9 1995/04/29 23:21:33 mycroft Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)proc.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: proc.c,v 1.19 2003/06/11 21:09:50 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: proc.c,v 1.20 2003/09/19 03:18:52 millert Exp $";
#endif
#endif /* not lint */
@@ -969,7 +969,7 @@ dokill(Char **v, struct command *t)
}
if (Isdigit(v[0][1])) {
signum = atoi(short2str(v[0] + 1));
- if (signum < 0 || signum > NSIG)
+ if (signum < 0 || signum >= NSIG)
stderror(ERR_NAME | ERR_BADSIG);
}
else {