aboutsummaryrefslogtreecommitdiff
path: root/bin/kill/kill.c
diff options
context:
space:
mode:
authorJonathan Lemon <jlemon@FreeBSD.org>1997-08-21 21:34:43 +0000
committerJonathan Lemon <jlemon@FreeBSD.org>1997-08-21 21:34:43 +0000
commitd623c5c11e09af87e772ff4d3eaee8dc0da6165f (patch)
treeb6972c734f488aa31df0111e5b5e92d29ec33a3c /bin/kill/kill.c
parentb13364fea84f647cbdf2579e7ff8c7fedb217ce0 (diff)
downloadsrc-d623c5c11e09af87e772ff4d3eaee8dc0da6165f.tar.gz
src-d623c5c11e09af87e772ff4d3eaee8dc0da6165f.zip
Disallow empty arguments (eg: '') as process ids.
PR: 2631 Submitted by: Arne Henrik Juul <arnej@imf.unit.no>
Notes
Notes: svn path=/head/; revision=28554
Diffstat (limited to 'bin/kill/kill.c')
-rw-r--r--bin/kill/kill.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/kill/kill.c b/bin/kill/kill.c
index 91493b94c6e0..9ea3cb8fd75f 100644
--- a/bin/kill/kill.c
+++ b/bin/kill/kill.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kill.c,v 1.7 1997/06/03 06:24:50 charnier Exp $
+ * $Id: kill.c,v 1.8 1997/06/06 06:36:20 charnier Exp $
*/
#ifndef lint
@@ -78,7 +78,7 @@ main(argc, argv)
if (!isdigit(**argv))
usage();
numsig = strtol(*argv, &ep, 10);
- if (!*argv || *ep)
+ if (!**argv || *ep)
errx(1, "illegal signal number: %s", *argv);
if (numsig >= 128)
numsig -= 128;
@@ -110,7 +110,7 @@ main(argc, argv)
nosig(*argv);
} else if (isdigit(**argv)) {
numsig = strtol(*argv, &ep, 10);
- if (!*argv || *ep)
+ if (!**argv || *ep)
errx(1, "illegal signal number: %s", *argv);
if (numsig < 0 || numsig >= NSIG)
nosig(*argv);
@@ -124,7 +124,7 @@ main(argc, argv)
for (errors = 0; argc; argc--, argv++) {
pid = strtol(*argv, &ep, 10);
- if (!*argv || *ep) {
+ if (!**argv || *ep) {
warnx("illegal process id: %s", *argv);
errors = 1;
} else if (kill(pid, numsig) == -1) {