diff options
author | dwmalone <dwmalone@FreeBSD.org> | 2002-03-30 16:24:03 +0000 |
---|---|---|
committer | dwmalone <dwmalone@FreeBSD.org> | 2002-03-30 16:24:03 +0000 |
commit | 59fa66220ea04959e377ec1831047b655bbe4da6 (patch) | |
tree | b4af2c83128c6311bfc2c155dd27b8c013653a8b | |
parent | 2f7ae9b73937f5da2e6cdcd3158a0213362e9c74 (diff) | |
download | FreeBSD-src-59fa66220ea04959e377ec1831047b655bbe4da6.zip FreeBSD-src-59fa66220ea04959e377ec1831047b655bbe4da6.tar.gz |
Use the method described in the strtol man page to check if it parsed
the entire string. This avoids signed/unsigned comparison.
-rw-r--r-- | usr.bin/killall/killall.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/killall/killall.c b/usr.bin/killall/killall.c index 463ea5c..7be6bc6 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); |