/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strlcpy.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: narnaud +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2021/10/18 16:08:31 by narnaud #+# #+# */ /* Updated: 2022/03/24 09:22:49 by narnaud ### ########.fr */ /* */ /* ************************************************************************** */ #include "../libft.h" size_t ft_strlcpy(char *dst, const char *src, size_t dstsize) { size_t i; i = 0; while (dstsize && i < dstsize - 1 && src[i]) { dst[i] = src[i]; i++; } if (dstsize) dst[i] = '\0'; while (src[i]) i++; return (i); }