-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_bzero.c
More file actions
36 lines (31 loc) · 1.56 KB
/
Copy pathft_bzero.c
File metadata and controls
36 lines (31 loc) · 1.56 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
34
35
36
/* ************************************************************************** */
/* */
/* :::::::: */
/* ft_bzero.c :+: :+: */
/* +:+ */
/* By: cwesseli <cwesseli@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2022/10/10 09:26:21 by cwesseli #+# #+# */
/* Updated: 2022/10/14 13:01:36 by cwesseli ######## odam.nl */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_bzero(void *s, size_t n)
{
unsigned char *put_c;
size_t i;
put_c = (unsigned char *)s;
i = 0;
while (i++ < n)
*put_c++ = '\0';
}
// DESCRIPTION top
// The bzero() function erases the data in the n bytes of the memory
// starting at the location pointed to by s, by writing zeros (bytes
// containing '\0') to that area.
// The explicit_bzero() function performs the same task as bzero().
// It differs from bzero() in that it guarantees that compiler
// optimizations will not remove the erase operation if the compiler
// deduces that the operation is "unnecessary".
// RETURN VALUE top
// None.