-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_memalloc.c
27 lines (24 loc) · 1.09 KB
/
ft_memalloc.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memalloc.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mschumac <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/06/11 23:32:30 by mschumac #+# #+# */
/* Updated: 2017/06/11 23:41:52 by mschumac ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memalloc(size_t size)
{
int *new_array;
new_array = (int*)malloc(size);
if (size == 0 || !new_array)
return (NULL);
else
{
ft_memset(new_array, 0, size + 1);
return (new_array);
}
}