42_solong/libftx/libft/ft_strlcpy.c
Camille Chauvet 9e58abcd5c kekw
2022-12-22 17:54:17 +01:00

29 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strlcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/09/27 16:24:15 by cchauvet #+# #+# */
/* Updated: 2022/09/28 17:23:27 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
size_t ft_strlcpy(char *dst, const char *src, size_t size)
{
size_t i;
i = 0;
while (i + 1 < size && src[i])
{
dst[i] = src[i];
i++;
}
if (size)
dst[i] = 0;
return (ft_strlen(src));
}