Fixed incorrect get_params function signature

This commit is contained in:
2026-09-08 00:25:49 +03:00
parent c4d3dcc16c
commit dcc85ab478
3 changed files with 5 additions and 6 deletions
+3 -4
View File
@@ -8,7 +8,7 @@
ProgramOptions get_params(int argc, char *argv[])
{
int max_range = MAX_VALUES, num_entries = DEFAULT_NR_ENTRIES;
bool is_seed_specified = false;
bool is_seed_specified = false;
static struct option long_options[] = {
{"max-range", required_argument, 0, 'm' },
@@ -17,7 +17,6 @@ ProgramOptions get_params(int argc, char *argv[])
{0, 0, 0, 0 }
};
bool seed_found = false;
int option, option_index, seed = 0;
while (( option = getopt_long(argc, argv, "m:n:s:", long_options, &option_index)))
{
@@ -37,7 +36,7 @@ ProgramOptions get_params(int argc, char *argv[])
break;
case 's':
seed_found = true;
is_seed_specified = true;
seed = atoi(optarg);
break;
@@ -46,5 +45,5 @@ ProgramOptions get_params(int argc, char *argv[])
}
}
return {max_range, num_entries, seed_found ? std::optional<int>(seed): std::nullopt};
return {max_range, num_entries, is_seed_specified ? std::optional<int>(seed): std::nullopt};
}