Fixed array bug

master
vhaudiquet 1 year ago
parent 0307c7e7ed
commit bbe2b8ba05
  1. 2
      src/utils/array.c

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

Loading…
Cancel
Save