Bad numeric arguments or usernames should cause non-zero exit status.

This commit is contained in:
Tim J. Robbins 2002-05-25 10:37:24 +00:00
parent 01e9310be5
commit b8b53eef91
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=97270

View file

@ -104,17 +104,22 @@ main(int argc, char *argv[])
if (which == PRIO_USER) {
if ((pwd = getpwnam(*argv)) != NULL)
who = pwd->pw_uid;
else if (getnum("uid", *argv, &who))
else if (getnum("uid", *argv, &who)) {
errs++;
continue;
else if (who < 0) {
} else if (who < 0) {
warnx("%s: bad value", *argv);
errs++;
continue;
}
} else {
if (getnum("pid", *argv, &who))
if (getnum("pid", *argv, &who)) {
errs++;
continue;
}
if (who < 0) {
warnx("%s: bad value", *argv);
errs++;
continue;
}
}