1
0
This repository has been archived on 2024-10-25. You can view files and clone it, but cannot push or open issues or pull requests.
42-1st-piscine/ended/C02/ex10/ft_strlcpy.c
2023-08-06 20:12:38 +02:00

31 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strlcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ajoly <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/20 08:23:38 by ajoly #+# #+# */
/* Updated: 2022/07/20 08:23:41 by ajoly ### ########.fr */
/* */
/* ************************************************************************** */
unsigned int ft_strlcpy(char *dest, char *src, unsigned int size)
{
unsigned int i;
i = 0;
if (size > 0)
{
while (--size && src[i])
{
dest[i] = src[i];
i++;
}
dest[i] = '\0';
}
while (src[i])
i++;
return (i);
}