42_libft/ft_calloc.c
Camille Chauvet 1d0f0b1901 m
2022-09-27 16:29:23 +02:00

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);
}