-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_memset.c
24 lines (22 loc) · 1.04 KB
/
ft_memset.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memset.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jkiragu <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/03/18 16:21:29 by jkiragu #+# #+# */
/* Updated: 2022/04/29 23:39:35 by jkiragu ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memset(void *s1, int c, size_t len)
{
unsigned char *sptr;
sptr = (unsigned char *)s1;
while (len--)
{
*sptr++ = c;
}
return (s1);
}