Skip to content
Snippets Groups Projects
Commit c944a4e3 authored by Niels Möller's avatar Niels Möller
Browse files

(main): With no command line arguments. exit after dislaying usage

message.

Rev: nettle/examples/next-prime.c:1.4
parent 1c5bd25d
No related branches found
No related tags found
No related merge requests found
...@@ -61,7 +61,7 @@ main(int argc, char **argv) ...@@ -61,7 +61,7 @@ main(int argc, char **argv)
clock_t start; clock_t start;
clock_t end; clock_t end;
enum { OPT_FACTORIAL = -100, OPT_RANDOM }; enum { OPT_FACTORIAL = -100 };
static const struct option options[] = static const struct option options[] =
{ {
/* Name, args, flag, val */ /* Name, args, flag, val */
...@@ -101,7 +101,10 @@ main(int argc, char **argv) ...@@ -101,7 +101,10 @@ main(int argc, char **argv)
argv += optind; argv += optind;
if (argc != 1) if (argc != 1)
{
usage(); usage();
return EXIT_FAILURE;
}
mpz_init(n); mpz_init(n);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment