timeout(1): fix the acceptable range values for parse_signal()

Before both 0 and sys_nsig would be successfully returned by parse_signal()
although being invalid signal numbers.

PR:		Alexandre Perrin <alex@kaworu.ch>
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D3990
This commit is contained in:
Baptiste Daroussin 2015-10-24 13:47:03 +00:00
parent 385490cb81
commit 44a94685f3

View File

@ -105,7 +105,7 @@ parse_signal(const char *str)
int sig, i; int sig, i;
const char *errstr; const char *errstr;
sig = strtonum(str, 0, sys_nsig, &errstr); sig = strtonum(str, 1, sys_nsig - 1, &errstr);
if (errstr == NULL) if (errstr == NULL)
return (sig); return (sig);