/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strlcpy.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/10/07 12:28:47 by cacharle #+# #+# */ /* Updated: 2019/10/21 11:05:52 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ #include #include "libft.h" size_t ft_strlcpy(char *dst, const char *src, size_t size) { unsigned int i; if (dst == NULL || src == NULL) return (0); if (size == 0) return (ft_strlen(src)); i = -1; while (++i < size - 1 && src[i] != '\0') dst[i] = src[i]; dst[i] = '\0'; return (ft_strlen(src)); }