(da).count = 0;\\r
(da).items = C_MALLOC(sizeof(elm) * (da).capacity);\\r
}\\r
- if ((da).count + 1 > (da).capacity) {\\r
+ if ((da).count >= (da).capacity) {\\r
(da).capacity *= 2;\\r
- c_ASSERT(C_REALLOC((da).items, (da).capacity * sizeof(*(da).items)) != NULL, "TODO: Log error instead of asserting");\\r
+ (da).items = C_REALLOC((da).items, (da).capacity * sizeof(elm));\\r
+ c_ASSERT((da).items != NULL, "TODO: Log error instead of asserting");\\r
}\\r
(da).items[(da).count++] = elm;\\r
} while (0)\r