/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_calloc.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: rzy +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2026/08/24 01:03:26 by rzy #+# #+# */ /* Updated: 2026/08/24 01:03:38 by rzy ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" void *ft_calloc(size_t n, size_t size) { unsigned char *ptr; size_t i; ptr = (unsigned char *)malloc(n * size); if (ptr == NULL) return (NULL); i = 0; while (i < (n * size)) { ptr[i] = 0; ++i; } return (ptr); }