/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strlcpy.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: adjoly +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/07/18 13:39:08 by adjoly #+# #+# */ /* Updated: 2023/07/18 19:49:31 by adjoly ### ########.fr */ /* */ /* ************************************************************************** */ unsigned int ft_strlcpy(char *dest, char *src, unsigned int size) { unsigned int i; i = 0; if (size == 0) { while (src[i]) i++; return (i); } while (src[i] && i + 1 < size) { dest[i] = src[i]; i++; } while (i < size) { dest[i] = '\0'; i++; } i = 0; while (src[i]) i++; return (i); }