-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_bzero.c
40 lines (37 loc) · 1.38 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
30
31
32
33
34
35
36
37
38
39
40
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_bzero.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: estettle <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/26 10:55:05 by estettle #+# #+# */
/* Updated: 2024/10/01 10:56:52 by estettle ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/**
* @brief Sets n bytes in the s memory area to 0.
*
* @param s The memory area to zero out.
* @param n The number of bytes to set to 0.
*/
void ft_bzero(void *s, size_t n)
{
if (n == 0)
return ;
ft_memset(s, 0, n);
}
/*
int main(void)
{
char *melody = malloc(100);
char *roxy = malloc(100);
printf("[!] Testing ft_bzero()...\n");
bzero(melody, 3);
ft_bzero(roxy, 3);
printf("[Test 1] : %s\t%s\n", melody, roxy);
ft_bzero(roxy, 0);
printf("[Test 2] : %s\t%s\n", melody, roxy);
}
*/