-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_memalloc.c
30 lines (27 loc) · 1.08 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
28
29
30
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memalloc.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ybitton <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/24 15:32:20 by ybitton #+# #+# */
/* Updated: 2017/01/16 16:41:03 by ybitton ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdlib.h>
#include "fillit.h"
void *ft_memalloc(size_t size)
{
char *c;
size_t i;
if ((c = malloc(size)) == NULL)
return (NULL);
i = 0;
while (i < size)
{
c[i] = 0;
i++;
}
return (c);
}