o Fix an arguments number check in -n case.

o Remove duplicated prio check, donice() makes it for us.

Spotted by:	David Schultz <dschultz@uclink.Berkeley.EDU>
MFC after:	1 week
This commit is contained in:
Maxim Konovalov 2002-04-10 13:38:09 +00:00
parent 380ee390fd
commit 8143906680

View File

@ -82,17 +82,12 @@ main(int argc, char *argv[])
if (strcmp(*argv, "-n") == 0) {
incr = 1;
argc--, argv++;
if (argc == 0)
if (argc < 2)
usage();
}
if (getnum("priority", *argv, &prio))
return (1);
prio = atoi(*argv);
argc--, argv++;
if (prio > PRIO_MAX)
prio = PRIO_MAX;
if (prio < PRIO_MIN)
prio = PRIO_MIN;
for (; argc > 0; argc--, argv++) {
if (strcmp(*argv, "-g") == 0) {
which = PRIO_PGRP;