|
|
@ -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:"); |
|
|
|