26 lines
1 KiB
C
26 lines
1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_memset.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: grobledo <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2023/02/02 18:40:30 by grobledo #+# #+# */
|
|
/* Updated: 2023/02/02 18:40:33 by grobledo ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
#include "libft.h"
|
|
|
|
void *ft_memset(void *str, int c, size_t n)
|
|
{
|
|
int i;
|
|
|
|
i = 0;
|
|
while (n != 0)
|
|
{
|
|
(((unsigned char *)str)[i]) = c;
|
|
i++;
|
|
n--;
|
|
}
|
|
return ((void *)str);
|
|
}
|