28 lines
1.1 KiB
C
28 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_strlcpy.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: grobledo <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2023/02/02 19:33:21 by grobledo #+# #+# */
|
|
/* Updated: 2023/02/02 19:33:24 by grobledo ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
#include "libft.h"
|
|
|
|
int ft_strlcpy(char *dest, const char *src, size_t size)
|
|
{
|
|
unsigned int i;
|
|
|
|
i = 0;
|
|
if (size == 0)
|
|
return (ft_strlen(src));
|
|
while (src[i] && i < size - 1)
|
|
{
|
|
dest[i] = src[i];
|
|
i++;
|
|
}
|
|
dest[i] = '\0';
|
|
return (ft_strlen(src));
|
|
}
|