Closed cassepipe closed 4 years ago
The following code passes the tests for ft_calloc ...
static void *ft_memalloc(size_t size) { void *data; data = malloc(size); if (data) ft_bzero(data, size); return (data); } void *ft_calloc(size_t count, size_t size) { return (ft_memalloc(count * size)); }
But this one fails with "your calloc does not work with empty string " :
void *ft_calloc(size_t count, size_t size) { void *data; data = malloc(count * size); if (data) ft_bzero(data, size); return (data); }
What am I missing ? Is this a bug ?
In the second code block, should be ft_bzero(data, count * size);
ft_bzero(data, count * size);
The following code passes the tests for ft_calloc ...
But this one fails with "your calloc does not work with empty string " :
What am I missing ? Is this a bug ?