Fix bug detected by previous test.

This commit is contained in:
Patrick Pelissier committed 2017-07-06 10:26:14 +02:00
1 parent 4e55aca639
commit 2155df7d6f
1 file changed
+3 -2
+3 -2
View File
@@ -539,8 +539,9 @@
M_C3(array_, name, _last_p)(const array_it_t it) \
{ \
assert(it != NULL && it->array != NULL); \
/* NOTE: Case index=0 & size=0 ==> true since unsigned type */ \
return (it->index) >= it->array->size-1; \
/* NOTE: Can not compute 'size-1' due to potential overflow \
if size was 0 */ \
return it->index + 1 >= it->array->size; \
} \
\
static inline bool \