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

27
libft/ft_strdup.c Executable file
View file

@ -0,0 +1,27 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strdup.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: thrieg <thrieg@student.42mulhouse.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/14 18:57:34 by thrieg #+# #+# */
/* Updated: 2025/02/16 19:04:44 by thrieg ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strdup(const char *s)
{
char *dup_str;
size_t size;
if (!s)
return (NULL);
size = (ft_strlen(s) + 1);
dup_str = malloc(sizeof(char) * size);
if (!dup_str)
return (0);
return (ft_memcpy(dup_str, s, size));
}