diff --git a/example-clients/metro.c b/example-clients/metro.c index 6274ce22..1742a599 100644 --- a/example-clients/metro.c +++ b/example-clients/metro.c @@ -154,7 +154,7 @@ main (int argc, char *argv[]) {0, 0, 0, 0} }; - while ((opt = getopt_long (argc, argv, options, long_options, &option_index)) != EOF) { + while ((opt = getopt_long (argc, argv, options, long_options, &option_index)) != -1) { switch (opt) { case 'f': if ((freq = atoi (optarg)) <= 0) { diff --git a/example-clients/netmaster.c b/example-clients/netmaster.c index 6128ef27..e1d14a86 100644 --- a/example-clients/netmaster.c +++ b/example-clients/netmaster.c @@ -73,7 +73,7 @@ main (int argc, char *argv[]) {0, 0, 0, 0} }; - while ((opt = getopt_long (argc, argv, options, long_options, &option_index)) != EOF) { + while ((opt = getopt_long (argc, argv, options, long_options, &option_index)) != -1) { switch (opt) { diff --git a/example-clients/server_control.cpp b/example-clients/server_control.cpp index a03e0e26..7b7f57bc 100644 --- a/example-clients/server_control.cpp +++ b/example-clients/server_control.cpp @@ -153,9 +153,10 @@ int main(int argc, char *argv[]) struct option long_options[] = { {"driver", 1, 0, 'd'}, {"client", 1, 0, 'c'}, + {0, 0, 0, 0} }; - while ((opt = getopt_long (argc, argv, options, long_options, &option_index)) != EOF) { + while ((opt = getopt_long (argc, argv, options, long_options, &option_index)) != -1) { switch (opt) { case 'd': driver_name = optarg;