-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_malloc.c
executable file
·27 lines (24 loc) · 1.09 KB
/
ft_malloc.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_malloc.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: akharrou <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/02/19 07:21:05 by akharrou #+# #+# */
/* Updated: 2019/05/01 19:14:16 by akharrou ### ########.fr */
/* */
/* ************************************************************************** */
#include "../Includes/stdlib_42.h"
void *ft_malloc(size_t size, char c)
{
void *buf;
size_t i;
buf = (void *)malloc(size);
if (!buf)
return (NULL);
i = 0;
while (size > i)
((char *)buf)[i++] = c;
return (buf);
}