add day 14 and try part2 with mlx (didn't work)
This commit is contained in:
32
2024/14/libft/ft_strlcpy.c
Executable file
32
2024/14/libft/ft_strlcpy.c
Executable file
@ -0,0 +1,32 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_strlcpy.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: tomoron <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/07/14 01:08:34 by tomoron #+# #+# */
|
||||
/* Updated: 2023/10/31 18:26:25 by tomoron ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
size_t ft_strlcpy(char *dest, const char *src, size_t size)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
i = 0;
|
||||
if (size == 0)
|
||||
return (ft_strlen(src));
|
||||
while (src[i] && i < size)
|
||||
{
|
||||
dest[i] = src[i];
|
||||
i++;
|
||||
}
|
||||
if (i == size)
|
||||
dest[i - 1] = 0;
|
||||
else
|
||||
dest[i] = 0;
|
||||
return (ft_strlen(src));
|
||||
}
|
Reference in New Issue
Block a user