skeletton untested project

This commit is contained in:
thrieg 2025-12-11 06:18:16 +01:00
commit 6fc620e8f4
187 changed files with 6584 additions and 0 deletions

30
libft/ft_calloc.c Executable file
View file

@ -0,0 +1,30 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_calloc.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: thrieg <thrieg@student.42mulhouse.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/14 19:42:05 by thrieg #+# #+# */
/* Updated: 2025/02/16 19:03:37 by thrieg ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_calloc(size_t nmemb, size_t size)
{
void *ret;
if ((size == 0) || (nmemb == 0))
{
return (malloc(0));
}
if (nmemb > __SIZE_MAX__ / size)
return (NULL);
ret = malloc(nmemb * size);
if (!ret)
return (NULL);
ft_bzero(ret, (nmemb * size));
return (ret);
}