28 lines
1.1 KiB
C
28 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_memalloc.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: gbrochar <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2015/11/28 18:11:36 by gbrochar #+# #+# */
|
|
/* Updated: 2015/11/29 10:28:31 by gbrochar ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libft.h"
|
|
|
|
void *ft_memalloc(size_t size)
|
|
{
|
|
unsigned char *ptr;
|
|
size_t i;
|
|
|
|
i = 0;
|
|
ptr = (unsigned char *)malloc(size);
|
|
if (!ptr)
|
|
return (NULL);
|
|
while (i < size)
|
|
ptr[i++] = 0;
|
|
return (ptr);
|
|
}
|