commit | 560c60d342a76076f0557a3946924c6478470044 | [log] [tgz] |
---|---|---|
author | Fuzzer 1121 <fuzzer1121@proton.me> | Tue Apr 23 13:46:16 2024 +0200 |
committer | Marat Dukhan <maratek@gmail.com> | Sun Jun 16 12:49:19 2024 -0700 |
tree | 9fea1ce50419c2ee6c3bf4c00a55e10c4b530cfa | |
parent | 178e3e0646cc671708bf78e77c273940130ac637 [diff] |
assert divisor is not 0 in divide_round_up
diff --git a/src/threadpool-utils.h b/src/threadpool-utils.h index 0b81360..970210b 100644 --- a/src/threadpool-utils.h +++ b/src/threadpool-utils.h
@@ -1,5 +1,6 @@ #pragma once +#include <assert.h> #include <stdint.h> #include <stddef.h> @@ -105,6 +106,7 @@ } static inline size_t divide_round_up(size_t dividend, size_t divisor) { + assert(divisor != 0); if (dividend % divisor == 0) { return dividend / divisor; } else {