Fixed array bug
This commit is contained in:
parent
0307c7e7ed
commit
bbe2b8ba05
@ -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:");
|
||||
|
Loading…
Reference in New Issue
Block a user