small fix in array lists

This commit is contained in:
FelixBrendel
2020-02-10 15:37:22 +01:00
parent 7b128b33c9
commit 60e3253036
+1 -1
View File
@@ -52,7 +52,7 @@ struct Array_List {
} }
void reserve(unsigned int count) { void reserve(unsigned int count) {
if (next_index+count <= (unsigned int)length) { if (next_index+count >= (unsigned int)length) {
length *= 2; length *= 2;
data = (type*)realloc(data, length * sizeof(type)); data = (type*)realloc(data, length * sizeof(type));
} }