Use nsig instead of arbitrary numbers

* filter_qualify.c (sigstr_to_uint): Use nsig.
* prctl.c (SYS_FUNC(prctl)) <case PR_SET_PDEATHSIG>: Use nsig.
This commit is contained in:
Eugene Syromyatnikov 2018-09-27 07:56:25 +02:00
parent 6d024c6336
commit bca1b70f6b
2 changed files with 3 additions and 3 deletions

View File

@ -52,12 +52,12 @@ static int
sigstr_to_uint(const char *s)
{
if (*s >= '0' && *s <= '9')
return string_to_uint_upto(s, 255);
return string_to_uint_upto(s, nsig);
if (strncasecmp(s, "SIG", 3) == 0)
s += 3;
for (int i = 0; i <= 255; ++i) {
for (size_t i = 0; i <= nsig; i++) {
const char *name = signame(i);
if (strncasecmp(name, "SIG", 3) != 0)

View File

@ -335,7 +335,7 @@ SYS_FUNC(prctl)
case PR_SET_PDEATHSIG:
tprints(", ");
if (arg2 > 128)
if (arg2 > nsig)
tprintf("%" PRI_klu, arg2);
else
tprints(signame(arg2));