30 lines
1.1 KiB
C
30 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/27 16:29:08 by cchauvet ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libft.h"
|
|
|
|
char *strlcpy(char *dst, const char *src, size_t size)
|
|
{
|
|
char *str;
|
|
size_t i;
|
|
|
|
i = 0;
|
|
str = (char *) src;
|
|
while (str[i + 1] && dst[i + 1] && i < size - 1)
|
|
{
|
|
dst[i] = src[i];
|
|
i++;
|
|
}
|
|
dst[i] = 0;
|
|
return (dst);
|
|
}
|