base struct

This commit is contained in:
gazhonsepaskwa
2025-01-13 13:21:53 +01:00
parent a7e1a55200
commit 09c2cb5b3e
47 changed files with 1835 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_calloc.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: nalebrun <nalebrun@student.s19.be> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/14 15:18:45 by nalebrun #+# #+# */
/* Updated: 2024/11/25 16:14:20 by nalebrun ### ########.fr */
/* */
/* ************************************************************************** */
#include "../../libft.h"
void *ft_calloc(size_t count, size_t size)
{
void *ptr;
if ((size != 0 && ((count * size) / size != count)) || (size >= 2147483647
&& count >= 2147483647))
return (NULL);
ptr = malloc(count * size);
if (!ptr)
return (NULL);
ft_bzero(ptr, count * size);
return (ptr);
}