base c lib without external lib

This commit is contained in:
David Gailleton
2025-11-05 19:25:22 +01:00
parent e06b98052a
commit 697e044d7e
19 changed files with 445 additions and 13 deletions

24
ft_strlcpy.c Normal file
View File

@@ -0,0 +1,24 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strlcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/11/05 13:31:13 by dgaillet #+# #+# */
/* Updated: 2025/11/05 17:10:52 by dgaillet ### ########lyon.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
size_t ft_strlcpy(char *dst, const char *src, size_t size)
{
size_t i;
i = 0;
while (src[i++] && size > (i - 1))
dst[i] = src[i];
dst[i] = '\0';
return (ft_strlen(src));
}