style: reoarginsed the file and fix the makefile
This commit is contained in:
parent
ecd9608320
commit
a5fe7484a1
46 changed files with 140 additions and 49 deletions
31
str/ft_strlcpy.c
Normal file
31
str/ft_strlcpy.c
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_strlcpy.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/11/07 16:55:25 by rparodi #+# #+# */
|
||||
/* Updated: 2023/11/13 19:16:30 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
size_t ft_strlcpy(char *dst, const char *src, size_t size)
|
||||
{
|
||||
size_t 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));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue