blob: c1fcda6d4209632695aeb6036452288da3f80b3d (
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
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memset.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/10/07 10:01:23 by cacharle #+# #+# */
/* Updated: 2019/10/21 11:35:07 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
#include <string.h>
#include "libft.h"
void *ft_memset(void *s, int c, size_t n)
{
t_byte cast_c;
t_byte *cast_s;
if (s == NULL)
return (NULL);
cast_c = (t_byte)c;
cast_s = (t_byte*)s;
while (n-- > 0)
*cast_s++ = cast_c;
return (s);
}
|