About Social Code
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/util/bitset.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/bitset.h b/src/util/bitset.h
index dd9a8bebae3..5313f85fcee 100644
--- a/src/util/bitset.h
+++ b/src/util/bitset.h
@@ -151,7 +151,7 @@ __bitset_next_set(unsigned i, BITSET_WORD *tmp,
* @param __size number of bits in the set to consider
*/
#define BITSET_FOREACH_SET(__i, __set, __size) \
- for (BITSET_WORD __tmp = *(__set), *__foo = &__tmp; __foo != NULL; __foo = NULL) \
+ for (BITSET_WORD __tmp = (__size) == 0 ? 0 : *(__set), *__foo = &__tmp; __foo != NULL; __foo = NULL) \
for (__i = 0; \
(__i = __bitset_next_set(__i, &__tmp, __set, __size)) < __size;)