getopt(3) returns -1, not EOF.

This commit is contained in:
Kevin Lo 2008-02-18 03:19:25 +00:00
parent a84bcdcea5
commit 8f9872ccb3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=176380
4 changed files with 4 additions and 4 deletions

View File

@ -133,7 +133,7 @@ main(argc, argv)
b.prefix = NULL;
b.lorder = 0;
while ((c = getopt(argc, argv, "bc:di:lp:ru")) != EOF) {
while ((c = getopt(argc, argv, "bc:di:lp:ru")) != -1) {
switch (c) {
case 'b':
b.lorder = BIG_ENDIAN;

View File

@ -99,7 +99,7 @@ main(argc, argv)
fname = NULL;
oflags = O_CREAT | O_RDWR;
sflag = 0;
while ((ch = getopt(argc, argv, "f:i:lo:s")) != EOF)
while ((ch = getopt(argc, argv, "f:i:lo:s")) != -1)
switch (ch) {
case 'f':
fname = optarg;

View File

@ -44,7 +44,7 @@ char *argv[];
progname = argv[0];
while ((c = getopt(argc, argv, "c:e:S:E:x")) != EOF)
while ((c = getopt(argc, argv, "c:e:S:E:x")) != -1)
switch (c) {
case 'c': /* compile options */
copts = options('c', optarg);

View File

@ -387,7 +387,7 @@ main(int argc, char * argv[])
if (geteuid() != 0)
errx(1, "must be root to run");
while ((ch = getopt(argc, argv, "a:b:i:n:p:P:r:v")) != EOF)
while ((ch = getopt(argc, argv, "a:b:i:n:p:P:r:v")) != -1)
switch (ch) {
case 'a':
parse_mode(optarg, &mode_ac, ch);