A lot of edit but adding the struct (Yes, i just use parameters of the function util now, See u morrow)

This commit is contained in:
Raphaël 2024-04-01 01:55:59 +02:00
parent 9c4dfafdf7
commit 56655f5426
15 changed files with 403 additions and 30 deletions

31
libft/ft_strlcpy.c Normal file
View file

@ -0,0 +1,31 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strlcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/07 16:55:25 by rparodi #+# #+# */
/* Updated: 2024/04/01 01:38:28 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
#include "../includes/minishell.h"
t_usize ft_strlcpy(t_str dst, t_const_str src, t_usize size)
{
t_usize i;
i = 0;
while (src[i] && i + 1 < size)
{
dst[i] = src[i];
i++;
}
if (size > 0)
{
dst[i] = '\0';
i++;
}
return (ft_strlen(src));
}