From acff7274d27fb0b3020f1fbfe0a8a38f80128622 Mon Sep 17 00:00:00 2001 From: Nikola Date: Sat, 4 Jul 2026 23:28:20 +0200 Subject: [PATCH] Fixed: -B now gives error for values lower than 1 --- Implementierung/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Implementierung/main.c b/Implementierung/main.c index 8fc786a..b60eab4 100644 --- a/Implementierung/main.c +++ b/Implementierung/main.c @@ -139,7 +139,7 @@ int main(int argc, char** argv) int version_to_use = 0; // actual initial value _Bool colored = 0; // actual initial value - unsigned amount_function_called = 0; // initial values, so that the compiler doesn't complain + int amount_function_called = 0; // initial values, so that the compiler doesn't complain unsigned n = 0; float starting_point_real = 0; float starting_point_imaginary = 0; @@ -168,7 +168,7 @@ int main(int argc, char** argv) case 'B': // done, function needed // wird die Laufzeit der angegebenen Implementierung gemessen und ausgegeben (do this later) - amount_function_called = strtoul(optarg,NULL,10); + int amount_function_called = strtol(optarg,NULL,10); if (amount_function_called <= 0) { printf("Invalid benchmarking input, the value should be greater than 0\n"); return 1;