Dont's use temporary pointer *end when it can point to nowhere,
instead terminate the *arg itself and skip rest of cycle.

Signed-off-by: Alexey Fomenko <[email protected]>
---
 procps/kill.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/procps/kill.c b/procps/kill.c
index 224e5ad..f17323d 100644
--- a/procps/kill.c
+++ b/procps/kill.c
@@ -255,8 +255,9 @@ 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';
+                               *arg = '\0'; /* terminate *arg and leave cycle, 
end can point to nowhere */
                                errors++;
+                               continue;
                        } else if (kill(pid, signo) != 0) {
                                bb_perror_msg("can't kill pid %d", (int)pid);
                                errors++;
-- 
1.7.2.5

_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to