Die early if signal is invalid in -signum
This commit is contained in:
parent
0967d2e278
commit
c0f540162f
1
kill.c
1
kill.c
|
@ -58,6 +58,7 @@ main(int argc, char *argv[])
|
||||||
sig = strtol(&argv[0][1], &end, 10);
|
sig = strtol(&argv[0][1], &end, 10);
|
||||||
if (*end != '\0' || errno != 0)
|
if (*end != '\0' || errno != 0)
|
||||||
eprintf("%s: bad signal number\n", &argv[0][1]);
|
eprintf("%s: bad signal number\n", &argv[0][1]);
|
||||||
|
sig2name(sig);
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
} else if (strcmp(argv[0], "-l") == 0) {
|
} else if (strcmp(argv[0], "-l") == 0) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user