Getopt(3) returns -1, not EOF.
This commit is contained in:
parent
6657154218
commit
52fa104235
@ -306,9 +306,9 @@ register char **argv;
|
||||
pat = NULL;
|
||||
|
||||
# ifdef DEBUG
|
||||
while ((ch = getopt(argc, argv, "aDefilm:osw")) != EOF)
|
||||
while ((ch = getopt(argc, argv, "aDefilm:osw")) != -1)
|
||||
#else
|
||||
while ((ch = getopt(argc, argv, "aefilm:osw")) != EOF)
|
||||
while ((ch = getopt(argc, argv, "aefilm:osw")) != -1)
|
||||
#endif /* DEBUG */
|
||||
switch(ch) {
|
||||
case 'a': /* any fortune */
|
||||
|
@ -115,7 +115,7 @@ char **argv;
|
||||
|
||||
srandomdev();
|
||||
|
||||
while ((ch = getopt(argc, argv, "l:w:")) != EOF)
|
||||
while ((ch = getopt(argc, argv, "l:w:")) != -1)
|
||||
switch((char)ch) {
|
||||
#ifdef notdef
|
||||
case 'd':
|
||||
|
Loading…
Reference in New Issue
Block a user