mirror of
https://github.com/DavidGailleton/42-Push_Swap.git
synced 2026-01-27 00:41:57 +00:00
32 lines
1.1 KiB
C
32 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_strlcpy.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: mteriier <mteriier@student.42lyon.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2025/11/06 16:33:57 by mteriier #+# #+# */
|
|
/* Updated: 2025/11/13 10:58:32 by mteriier ### ########lyon.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "parsing.h"
|
|
|
|
int ft_strlcpy(char *dst, const char *src, int size)
|
|
{
|
|
int i;
|
|
int len;
|
|
|
|
len = ft_strlen(src);
|
|
i = 0;
|
|
if (size == 0)
|
|
return (len);
|
|
while (i < size - 1 && src[i])
|
|
{
|
|
dst[i] = src[i];
|
|
i++;
|
|
}
|
|
dst[i] = '\0';
|
|
return (len);
|
|
}
|