25 lines
1.1 KiB
C
25 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_calloc.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2022/09/27 16:09:01 by cchauvet #+# #+# */
|
|
/* Updated: 2022/09/27 16:12:30 by cchauvet ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libft.h"
|
|
|
|
void *calloc(size_t nmemb, size_t size)
|
|
{
|
|
char *tab;
|
|
|
|
if (nmemb * size == 0)
|
|
return (NULL);
|
|
tab = malloc(nmemb * size);
|
|
ft_bzero(tab, nmemb * size);
|
|
return (tab);
|
|
}
|