-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_memset.c
20 lines (18 loc) · 1.03 KB
/
ft_memset.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memset.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gmachado <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/04/06 02:29:11 by gmachado #+# #+# */
/* Updated: 2022/04/18 20:06:16 by gmachado ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memset(void *s, int c, size_t n)
{
while (n-- != 0)
((unsigned char *)s)[n] = (unsigned char)c;
return ((unsigned char *)s);
}