-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathft_memalloc.c
More file actions
27 lines (24 loc) · 1.06 KB
/
ft_memalloc.c
File metadata and controls
27 lines (24 loc) · 1.06 KB
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: akassil <akassil@student.42.us.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/04/29 14:02:06 by akassil #+# #+# */
/* Updated: 2018/05/02 16:00:29 by akassil ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
#include <stdlib.h>
void *ft_memalloc(size_t size)
{
void *r;
void *temp;
r = (malloc(size));
temp = r;
if (r)
while (size--)
*(char *)r++ = 0;
return (temp);
}