summaryrefslogtreecommitdiff
path: root/procps
diff options
context:
space:
mode:
authorEric Andersen2003-08-06 07:43:58 +0000
committerEric Andersen2003-08-06 07:43:58 +0000
commit8f4ef159f09e1b5d09f7f7d2fcbf9e4a78c375c7 (patch)
treea7276959fc8907e0ab78c003963bb852307dabff /procps
parentc774efe317442ee8e62ce2c6594c5e57776a8eee (diff)
downloadbusybox-8f4ef159f09e1b5d09f7f7d2fcbf9e4a78c375c7.zip
busybox-8f4ef159f09e1b5d09f7f7d2fcbf9e4a78c375c7.tar.gz
Fixup segfault on 'kill -q'
Diffstat (limited to 'procps')
-rw-r--r--procps/kill.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/procps/kill.c b/procps/kill.c
index f11623e..22bb98a 100644
--- a/procps/kill.c
+++ b/procps/kill.c
@@ -32,8 +32,8 @@
#include <unistd.h>
#include "busybox.h"
-static const int KILL = 0;
-static const int KILLALL = 1;
+#define KILL 0
+#define KILLALL 1
extern int kill_main(int argc, char **argv)
{
@@ -43,7 +43,7 @@ extern int kill_main(int argc, char **argv)
#ifdef CONFIG_KILLALL
/* Figure out what we are trying to do here */
- whichApp = (strcmp(bb_applet_name, "killall") == 0)? KILLALL : KILL;
+ whichApp = (strcmp(bb_applet_name, "killall") == 0)? KILLALL : KILL;
#else
whichApp = KILL;
#endif
@@ -91,7 +91,7 @@ extern int kill_main(int argc, char **argv)
quiet++;
argv++;
argc--;
- if(argv[1][0] != '-'){
+ if(argc<2 || argv[1][0] != '-'){
goto do_it_now;
}
}
@@ -118,7 +118,7 @@ do_it_now:
argv++;
}
- }
+ }
#ifdef CONFIG_KILLALL
else {
pid_t myPid=getpid();