Die early if signal is invalid in -signum

This commit is contained in:
sin 2014-11-11 16:34:05 +00:00
parent 0967d2e278
commit c0f540162f

1
kill.c
View File

@ -58,6 +58,7 @@ main(int argc, char *argv[])
sig = strtol(&argv[0][1], &end, 10);
if (*end != '\0' || errno != 0)
eprintf("%s: bad signal number\n", &argv[0][1]);
sig2name(sig);
argc--;
argv++;
} else if (strcmp(argv[0], "-l") == 0) {