-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_calloc.c
22 lines (19 loc) · 1.06 KB
/
ft_calloc.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_calloc.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: hnoh <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/01/04 10:26:07 by hnoh #+# #+# */
/* Updated: 2021/01/04 10:27:40 by hnoh ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_calloc(size_t count, size_t size)
{
void *array;
if (!(array = (char *)malloc(size * count)))
return (NULL);
return (ft_memset(array, 0, size * count));
}