mirror of
https://github.com/KeyZox71/ft_minipowershell.git
synced 2025-03-15 11:26:51 +01:00
31 lines
1.1 KiB
C
31 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_strlcpy.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2023/11/01 09:52:45 by adjoly #+# #+# */
|
|
/* Updated: 2024/02/04 14:47:41 by adjoly ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "../libft.h"
|
|
|
|
size_t ft_strlcpy(char *dst, const char *src, size_t size)
|
|
{
|
|
size_t i;
|
|
|
|
i = 0;
|
|
if (size == 0)
|
|
return (ft_strlen(src));
|
|
while (i < size - 1 && src[i])
|
|
{
|
|
dst[i] = src[i];
|
|
i++;
|
|
}
|
|
if (i < size)
|
|
dst[i] = '\0';
|
|
return (ft_strlen(src));
|
|
}
|