diff --git a/include/villas/utils.h b/include/villas/utils.h index 0e29fba8e..e6ef0e469 100644 --- a/include/villas/utils.h +++ b/include/villas/utils.h @@ -221,7 +221,8 @@ __attribute__((always_inline)) static inline uint64_t rdtsc() /** Get log2 of long long integers */ static inline int log2i(long long x) { - assert(x > 0); + if (x == 0) + return 1; return sizeof(x) * 8 - __builtin_clzll(x) - 1; }