Before this patch, both 0 and sys_nsig would be successfully returned by parse_signal() although being invalid signal numbers.
Details
Details
- Reviewers
bapt - Commits
- rS289878: timeout(1): fix the acceptable range values for parse_signal()
none
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
strtonum(3) says that minval and maxval are inclusive:
int iterations; const char *errstr; iterations = strtonum(optarg, 1, 64, &errstr); if (errstr != NULL) errx(1, "number of iterations is %s: %s", errstr, optarg); The above example will guarantee that the value of iterations is between 1 and 64 (inclusive).