copy on git
This commit is contained in:
commit
42653de246
205 changed files with 7459 additions and 0 deletions
26
libft/ft_strlcat.c
Executable file
26
libft/ft_strlcat.c
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_strlcat.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: thrieg <thrieg@student.42mulhouse.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/10/14 16:24:30 by thrieg #+# #+# */
|
||||
/* Updated: 2025/02/16 19:04:48 by thrieg ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
size_t ft_strlcat(char *dst, const char *src, size_t size)
|
||||
{
|
||||
size_t dest_len;
|
||||
size_t src_len;
|
||||
|
||||
dest_len = ft_strlen(dst);
|
||||
src_len = ft_strlen(src);
|
||||
if (size <= dest_len)
|
||||
return (size + src_len);
|
||||
ft_strlcpy(&dst[dest_len], src, (size - dest_len));
|
||||
return (dest_len + src_len);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue