-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_memset.c
executable file
·30 lines (27 loc) · 1.12 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
29
30
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memset.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: wdebs <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/09/23 20:20:56 by wdebs #+# #+# */
/* Updated: 2016/09/29 23:03:16 by wdebs ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memset(void *b, int c, size_t len)
{
size_t i;
unsigned char new_c;
unsigned char *new_b;
i = 0;
new_b = (unsigned char *)b;
new_c = (unsigned char)c;
while (i < len)
{
new_b[i] = new_c;
i++;
}
return (b);
}