base struct
This commit is contained in:
26
lib/libft/srcs/mem/ft_bzero.c
Normal file
26
lib/libft/srcs/mem/ft_bzero.c
Normal file
@@ -0,0 +1,26 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_bzero.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: nalebrun <nalebrun@student.s19.be> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/10/10 16:07:05 by nalebrun #+# #+# */
|
||||
/* Updated: 2024/11/25 16:14:55 by nalebrun ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "../../libft.h"
|
||||
|
||||
void ft_bzero(void *s, size_t n)
|
||||
{
|
||||
char *ps;
|
||||
size_t i;
|
||||
|
||||
if (n == 0 || !s)
|
||||
return ;
|
||||
ps = (char *)s;
|
||||
i = 0;
|
||||
while (i < n)
|
||||
ps[i++] = 0;
|
||||
}
|
||||
Reference in New Issue
Block a user