From fb757ee269738e560d41ccd905a4ecbdd11a2d1e Mon Sep 17 00:00:00 2001 From: David Malone Date: Sat, 30 Mar 2002 16:24:03 +0000 Subject: [PATCH] Use the method described in the strtol man page to check if it parsed the entire string. This avoids signed/unsigned comparison. --- usr.bin/killall/killall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/killall/killall.c b/usr.bin/killall/killall.c index 463ea5cd33be..7be6bc620ae8 100644 --- a/usr.bin/killall/killall.c +++ b/usr.bin/killall/killall.c @@ -225,7 +225,7 @@ main(int ac, char **av) } if (user) { uid = strtol(user, &ep, 10); - if ((ep - user) < strlen(user)) { + if (*user == '\0' || *ep != '\0') { /* was it a number? */ pw = getpwnam(user); if (pw == NULL) errx(1, "user %s does not exist", user);