From 8b4a8734dd3bf4b00fffdbde4b0b271b50f89c19 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 13 Aug 2020 23:51:27 +0200 Subject: Fix potential division by zero --- test/btree_test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test/btree_test.c') diff --git a/test/btree_test.c b/test/btree_test.c index 7c470c0..df44081 100644 --- a/test/btree_test.c +++ b/test/btree_test.c @@ -125,7 +125,9 @@ test_fail(ZixBTree* t, const char* fmt, ...) static int stress(const unsigned test_num, const size_t n_elems) { - assert(n_elems > 0); + if (n_elems == 0) { + return 0; + } uintptr_t r = 0; ZixBTree* t = zix_btree_new(int_cmp, NULL, NULL); -- cgit v1.2.1