FIX first part of mandatory functions

This commit is contained in:
David Gailleton
2025-11-06 13:20:01 +01:00
parent 86f9f05889
commit 25a804847b
17 changed files with 115 additions and 48 deletions

View File

@@ -6,7 +6,7 @@
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/11/05 13:31:13 by dgaillet #+# #+# */
/* Updated: 2025/11/05 17:10:52 by dgaillet ### ########lyon.fr */
/* Updated: 2025/11/06 12:05:04 by dgaillet ### ########lyon.fr */
/* */
/* ************************************************************************** */
@@ -17,8 +17,14 @@ size_t ft_strlcpy(char *dst, const char *src, size_t size)
size_t i;
i = 0;
while (src[i++] && size > (i - 1))
dst[i] = src[i];
dst[i] = '\0';
if (size > 0)
{
while (src[i] && i < (size - 1))
{
dst[i] = src[i];
i++;
}
dst[i] = '\0';
}
return (ft_strlen(src));
}