-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_memset.c
28 lines (25 loc) · 1.05 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
25
26
27
28
/* ************************************************************************** */
/* */
/* :::::::: */
/* ft_memset.c :+: :+: */
/* +:+ */
/* By: kfu <[email protected]> +#+ */
/* +#+ */
/* Created: 2020/10/29 16:41:50 by kfu #+# #+# */
/* Updated: 2020/11/15 00:07:33 by kfu ######## odam.nl */
/* */
/* ************************************************************************** */
#include <stdlib.h>
void *ft_memset(void *buf, int c, size_t len)
{
unsigned char *s;
size_t i;
s = buf;
i = 0;
while (i < len)
{
s[i] = c;
i++;
}
return (buf);
}