Skip to content
Snippets Groups Projects
Commit 2a536226 authored by Andreas Gattringer's avatar Andreas Gattringer
Browse files

fixed command line argument parsing bug

parent 16f908bd
No related branches found
No related tags found
No related merge requests found
...@@ -289,8 +289,8 @@ struct program_options check_cats_main_arguments(int argc, char **argv) ...@@ -289,8 +289,8 @@ struct program_options check_cats_main_arguments(int argc, char **argv)
exit_cats(EXIT_FAILURE); exit_cats(EXIT_FAILURE);
} }
assert(optind < argc); assert(argc < 2 || optind < argc);
if (options.configuration_file == NULL && options.need_conf == true) { if (argc > 1 && options.configuration_file == NULL && options.need_conf == true) {
options.configuration_file = strdup(argv[optind]); options.configuration_file = strdup(argv[optind]);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment