/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_calloc.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: erey-bet +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/09/28 16:21:44 by erey-bet #+# #+# */ /* Updated: 2022/10/11 14:17:31 by erey-bet ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" void *ft_calloc(size_t nitems, size_t size) { size_t *tmp; if (nitems * size < nitems) return (NULL); tmp = malloc(nitems * size); if (tmp == NULL) return (NULL); ft_bzero(tmp, nitems * size); return (tmp); }