From bc264ab6f58177124d49a72b4a808eb97fa2cb25 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 2 Jul 2021 13:51:45 -0400 Subject: Avoid use of atoi() and atol() --- test/btree_test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/btree_test.c') diff --git a/test/btree_test.c b/test/btree_test.c index d4dd6b4..ccb0cbc 100644 --- a/test/btree_test.c +++ b/test/btree_test.c @@ -527,10 +527,10 @@ main(int argc, char** argv) return EXIT_FAILURE; } - const unsigned n_tests = 3; - unsigned n_elems = (argc > 1) ? (unsigned)atol(argv[1]) : 524288u; + const unsigned n_tests = 3u; + const size_t n_elems = (argc > 1) ? strtoul(argv[1], NULL, 10) : 524288u; - printf("Running %u tests with %u elements", n_tests, n_elems); + printf("Running %u tests with %lu elements", n_tests, n_elems); for (unsigned i = 0; i < n_tests; ++i) { printf("."); fflush(stdout); -- cgit v1.2.1