1
0
cub3d/libft/str/ft_strlcpy.c
2024-09-10 16:27:06 +02:00

31 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strlcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: madumerg <madumerg@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/31 10:08:10 by madumerg #+# #+# */
/* Updated: 2023/11/03 12:30:11 by madumerg ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
size_t ft_strlcpy(char *dest, const char *src, size_t destsize)
{
size_t i;
i = 0;
if (destsize > 0)
{
while (src[i] && i < destsize - 1)
{
dest[i] = src[i];
i++;
}
dest[i] = '\0';
}
return (ft_strlen(src));
}