-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_bzero.c
29 lines (27 loc) · 1.13 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: mmalie <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/04 15:33:40 by mmalie #+# #+# */
/* Updated: 2024/11/14 09:27:39 by mmalie ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/*
* Implementation of bzero() from <string.h>: Sets a block of memory to zero
* (equivalent to memset(ptr, 0, n)).
*/
void ft_bzero(void *s, size_t n)
{
char *s_p;
s_p = (char *)s;
while (n > 0)
{
*s_p = '\0';
s_p++;
n--;
}
}