As of POSIX.2, getopt returns -1 instead of EOF on error. Changed the code
to match just in case someone changes the value of EOF.
This commit is contained in:
parent
404b36ffd9
commit
6b9684b200
@ -39,7 +39,7 @@ char copyright[] =
|
||||
|
||||
#ifndef lint
|
||||
/*static char sccsid[] = "from: @(#)nice.c 5.4 (Berkeley) 6/1/90";*/
|
||||
static char rcsid[] = "$Id: nice.c,v 1.6 1993/11/10 20:01:20 jtc Exp $";
|
||||
static char rcsid[] = "$Id: nice.c,v 1.7 1993/11/19 20:07:13 jtc Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/time.h>
|
||||
@ -47,6 +47,7 @@ static char rcsid[] = "$Id: nice.c,v 1.6 1993/11/10 20:01:20 jtc Exp $";
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <locale.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <err.h>
|
||||
@ -64,6 +65,8 @@ main(argc, argv)
|
||||
int niceness = DEFNICE;
|
||||
int c;
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
|
||||
/* handle obsolete -number syntax */
|
||||
if (argc > 1 && argv[1][0] == '-' && isdigit(argv[1][1])) {
|
||||
niceness = atoi (argv[1] + 1);
|
||||
|
Loading…
Reference in New Issue
Block a user