29 lines
1.1 KiB
C
29 lines
1.1 KiB
C
|
/* ************************************************************************** */
|
||
|
/* */
|
||
|
/* ::: :::::::: */
|
||
|
/* ft_strlcpy.c :+: :+: :+: */
|
||
|
/* +:+ +:+ +:+ */
|
||
|
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
||
|
/* +#+#+#+#+#+ +#+ */
|
||
|
/* Created: 2022/09/27 16:24:15 by cchauvet #+# #+# */
|
||
|
/* Updated: 2022/09/28 17:23:27 by cchauvet ### ########.fr */
|
||
|
/* */
|
||
|
/* ************************************************************************** */
|
||
|
|
||
|
#include "libft.h"
|
||
|
|
||
|
size_t ft_strlcpy(char *dst, const char *src, size_t size)
|
||
|
{
|
||
|
size_t i;
|
||
|
|
||
|
i = 0;
|
||
|
while (i + 1 < size && src[i])
|
||
|
{
|
||
|
dst[i] = src[i];
|
||
|
i++;
|
||
|
}
|
||
|
if (size)
|
||
|
dst[i] = 0;
|
||
|
return (ft_strlen(src));
|
||
|
}
|