42-archive/malloc/srcs/ft_memset.c
Jack Halford 8e70deabc3 all good
2017-10-22 17:37:56 +02:00

23 lines
1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memset.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/10/22 14:37:31 by jhalford #+# #+# */
/* Updated: 2017/10/22 15:00:47 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */
#include "malloc_internal.h"
void *ft_memset(void *b, int c, size_t len)
{
size_t i;
i = -1;
while (++i < len)
((unsigned char *)b)[i] = (unsigned char)c;
return (b);
}