cub3d/libft/src/ft_memset.c

30 lines
1.0 KiB
C
Raw Normal View History

2023-10-25 13:56:45 +02:00
/* ************************************************************************** */
/* */
/* :::::::: */
2023-10-26 19:11:30 +02:00
/* ft_memset.c :+: :+: */
2023-10-25 13:56:45 +02:00
/* +:+ */
/* By: djonker <marvin@codam.nl> +#+ */
/* +#+ */
/* Created: 2020/11/01 08:42:45 by djonker #+# #+# */
2023-10-26 19:11:30 +02:00
/* Updated: 2023/10/18 17:00:00 by houtworm ######## odam.nl */
2023-10-25 13:56:45 +02:00
/* */
/* ************************************************************************** */
#include "../libft.h"
void *ft_memset(void *s, int c, size_t n)
{
char *p;
if (!s)
return (s);
p = s;
while (n > 0)
{
*p = c;
p++;
n--;
}
return (s);
}