-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_bzero.c
More file actions
33 lines (29 loc) · 1.23 KB
/
ft_bzero.c
File metadata and controls
33 lines (29 loc) · 1.23 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
30
31
32
33
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_bzero.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: kmoutaou <marvin@.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/11/04 13:36:10 by kmoutaou #+# #+# */
/* Updated: 2021/11/19 15:28:41 by kmoutaou ### ########.fr */
/* */
/* ************************************************************************** */
/*
ft_bzero is a re-coded bzero function from <string.h> that erases the data
in the n bytes of the memory stating at the location pointed to by str, by
writing -\0- to that area.
*/
#include "libft.h"
void ft_bzero(void *str, size_t n)
{
unsigned char *str0;
str0 = (unsigned char *)str;
while (n > 0)
{
*str0 = '\0';
str0++;
n--;
}
return ;
}