-
Notifications
You must be signed in to change notification settings - Fork 2
/
ft_bzero.c
29 lines (25 loc) · 1.23 KB
/
ft_bzero.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_bzero.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adiaz-lo <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/11/07 13:31:34 by adiaz-lo #+# #+# */
/* Updated: 2020/01/14 09:26:18 by adiaz-lo ### ########.fr */
/* */
/* ************************************************************************** */
/*
** This function erases the data in the 'n' bytes of the memory starting at the
** location pointed by 's', writing zeroes.
** For further information, please check the Standard C Library function
** bzero(void *s, size_t n)
*/
#include "libft.h"
void ft_bzero(void *s, size_t n)
{
unsigned char *s1;
s1 = (unsigned char *)s;
while (n-- > 0)
*(s1++) = '\0';
}