kill: fix infinite loop when passed PIDs are not valid numbers

Signed-off-by: Pere Orga <gotrunks@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Pere Orga 2011-03-07 16:22:17 +01:00 committed by Denys Vlasenko
parent 976ec23da5
commit 9283d7c5c2

View File

@ -219,6 +219,7 @@ int kill_main(int argc, char **argv)
pid = bb_strtoi(arg, &end, 10);
if (errno && (errno != EINVAL || *end != ' ')) {
bb_error_msg("invalid number '%s'", arg);
*end = '\0';
errors++;
} else if (kill(pid, signo) != 0) {
bb_perror_msg("can't kill pid %d", (int)pid);