-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_memalloc.c
executable file
·26 lines (23 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memalloc.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: luperez <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2014/11/15 17:34:29 by luperez #+# #+# */
/* Updated: 2014/11/22 13:08:25 by luperez ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memalloc(size_t size)
{
void *tmp;
if (size < 1)
return (NULL);
tmp = (void *)malloc(size + 1);
if (tmp == NULL)
return (NULL);
ft_bzero(tmp, size + 1);
return (tmp);
}