From 5a57d3e796ffd97cbe691cc76f89dde9f18d3ba7 Mon Sep 17 00:00:00 2001 From: kevlo Date: Tue, 6 Feb 2007 08:48:28 +0000 Subject: [PATCH] getopt(3) returns -1, not EOF. --- usr.bin/mklocale/yacc.y | 2 +- usr.sbin/ngctl/dot.c | 2 +- usr.sbin/ngctl/list.c | 2 +- usr.sbin/ngctl/main.c | 2 +- usr.sbin/ngctl/show.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.bin/mklocale/yacc.y b/usr.bin/mklocale/yacc.y index a41d02ed3d1a..84149f019480 100644 --- a/usr.bin/mklocale/yacc.y +++ b/usr.bin/mklocale/yacc.y @@ -227,7 +227,7 @@ main(int ac, char *av[]) fp = stdout; - while ((x = getopt(ac, av, "do:")) != EOF) { + while ((x = getopt(ac, av, "do:")) != -1) { switch(x) { case 'd': debug = 1; diff --git a/usr.sbin/ngctl/dot.c b/usr.sbin/ngctl/dot.c index 4b4fc768348b..bd4673fda4b4 100644 --- a/usr.sbin/ngctl/dot.c +++ b/usr.sbin/ngctl/dot.c @@ -70,7 +70,7 @@ DotCmd(int ac, char **av) /* Get options */ optind = 1; - while ((ch = getopt(ac, av, "")) != EOF) { + while ((ch = getopt(ac, av, "")) != -1) { switch (ch) { case '?': default: diff --git a/usr.sbin/ngctl/list.c b/usr.sbin/ngctl/list.c index 966a8a567e36..da4174c27e75 100644 --- a/usr.sbin/ngctl/list.c +++ b/usr.sbin/ngctl/list.c @@ -73,7 +73,7 @@ ListCmd(int ac, char **av) /* Get options */ optind = 1; - while ((ch = getopt(ac, av, "ln")) != EOF) { + while ((ch = getopt(ac, av, "ln")) != -1) { switch (ch) { case 'l': list_hooks = 1; diff --git a/usr.sbin/ngctl/main.c b/usr.sbin/ngctl/main.c index e4ba0b7ff93f..5747bca71384 100644 --- a/usr.sbin/ngctl/main.c +++ b/usr.sbin/ngctl/main.c @@ -147,7 +147,7 @@ main(int ac, char *av[]) snprintf(name, sizeof(name), "ngctl%d", getpid()); /* Parse command line */ - while ((ch = getopt(ac, av, "df:n:")) != EOF) { + while ((ch = getopt(ac, av, "df:n:")) != -1) { switch (ch) { case 'd': NgSetDebug(NgSetDebug(-1) + 1); diff --git a/usr.sbin/ngctl/show.c b/usr.sbin/ngctl/show.c index 5232645bbcae..26eea0468273 100644 --- a/usr.sbin/ngctl/show.c +++ b/usr.sbin/ngctl/show.c @@ -70,7 +70,7 @@ ShowCmd(int ac, char **av) /* Get options */ optind = 1; - while ((ch = getopt(ac, av, "n")) != EOF) { + while ((ch = getopt(ac, av, "n")) != -1) { switch (ch) { case 'n': no_hooks = 1;