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