fractol/libft/src/ft_memset.c

30 lines
1.0 KiB
C
Raw Normal View History

2023-03-01 04:36:42 +01:00
/* ************************************************************************** */
/* */
/* :::::::: */
2023-03-07 05:31:00 +01:00
/* ft_memset.c |o_o || | */
2023-03-01 04:36:42 +01:00
/* +:+ */
/* By: djonker <marvin@codam.nl> +#+ */
/* +#+ */
/* Created: 2020/11/01 08:42:45 by djonker #+# #+# */
2023-03-07 05:31:00 +01:00
/* Updated: 2023/02/28 20:13:47 by houtworm \___)=(___/ */
2023-03-01 04:36:42 +01:00
/* */
/* ************************************************************************** */
#include "../libft.h"
void *ft_memset(void *s, int c, size_t n)
{
char *p;
2023-03-07 05:31:00 +01:00
if (!s)
return (s);
2023-03-01 04:36:42 +01:00
p = s;
while (n > 0)
{
*p = c;
p++;
n--;
}
return (s);
}