-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_memset.c
More file actions
29 lines (27 loc) · 1.12 KB
/
ft_memset.c
File metadata and controls
29 lines (27 loc) · 1.12 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memset.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ouboukou <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/04 18:09:01 by ouboukou #+# #+# */
/* Updated: 2023/12/23 22:45:27 by ouboukou ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memset(void *s, int value, size_t n_byt)
{
unsigned char *str;
value = (unsigned char)value;
str = (unsigned char *)s;
if (n_byt == 0)
return (s);
while (n_byt)
{
*str = value;
n_byt--;
str++;
}
return (s);
}