blob: b94c6fa53b48190b7584f1b9ef375851e36d2e38 (
plain)
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
31
32
33
|
/* ************************************************************************** */
/* LE - / */
/* / */
/* ft_memset.c .:: .:/ . .:: */
/* +:+:+ +: +: +:+:+ */
/* By: rbousset <marvin@le-101.fr> +:+ +: +: +:+ */
/* #+# #+ #+ #+# */
/* Created: 2019/10/08 13:41:09 by rbousset #+# ## ## #+# */
/* Updated: 2019/10/13 08:38:10 by rbousset ### #+. /#+ ###.fr */
/* / */
/* / */
/* ************************************************************************** */
#include <stddef.h>
void
*ft_memset(void *b, int c, size_t len)
{
unsigned char *str;
str = b;
if (!b)
return (NULL);
if (!len)
return (b);
while (len > 0)
{
*str = (unsigned char)c;
str++;
len--;
}
return (b);
}
|