-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_memset.c
31 lines (27 loc) · 1.1 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
31
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memset.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: juolivei <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/01/20 19:50:38 by juolivei #+# #+# */
/* Updated: 2020/01/21 13:46:40 by juolivei ### ########.fr */
/* */
/* ************************************************************************** */
/*
** verificar o erro que não ocorre quando len > tamanho do de b
*/
#include "libft.h"
void *ft_memset(void *b, int c, size_t len)
{
char *begin;
begin = b;
while (len > 0)
{
*begin = c;
begin++;
len--;
}
return (b);
}