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:
4 files changed
+23
-4
No files matched your search
@@ -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")
|
||||
|
||||
Reference in new issue
Block a user