Fixed array bug

This commit is contained in:
vhaudiquet 2023-09-23 12:04:40 +02:00
parent 0307c7e7ed
commit bbe2b8ba05

View File

@ -31,7 +31,7 @@ void array_put(array_t* array, size_t index, void* elem)
// Make sure allocated space is big enough
if(index >= array->size)
{
array->data = realloc(array->data, (index + 1) * 2);
array->data = realloc(array->data, (index + 1) * 2 * sizeof(void*));
if(!array->data)
{
perror("Catastrophic memory allocation failure:");