bench: fail early if user inputs invalid value for SECP256K1_BENCH_ITERS

In this change the get_iters function was updated to print an error
message and then return 0. In the functions that use get_iters they
print the help text and then EXIT_FAILURE
This commit is contained in:
kevkevinpal committed 2026-01-23 08:07:22 -05:00
1 parent 4721e077b4
commit c09215f7af
4 files changed
+23 -4

No files matched your search

+5 -1
View File
@@ -385,9 +385,13 @@ static void bench_context(void* arg, int iters) {
int main(int argc, char **argv) {
bench_inv data;
int d = argc == 1; /* default */
int default_iters = 20000;
int iters = get_iters(default_iters);
int d = argc == 1; /* default */
if (iters == 0) {
help(default_iters);
return EXIT_FAILURE;
}
if (argc > 1) {
if (have_flag(argc, argv, "-h")