-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_strlcat.c
More file actions
27 lines (24 loc) · 1.19 KB
/
Copy pathft_strlcat.c
File metadata and controls
27 lines (24 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strlcat.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jihyjeon < jihyjeon@student.42seoul.kr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/11 13:46:51 by jihyjeon #+# #+# */
/* Updated: 2023/11/05 20:33:14 by jihyjeon ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
size_t ft_strlcat(char *dst, const char *src, size_t dstsize)
{
size_t dest_len;
size_t src_len;
dest_len = ft_strlen(dst);
src_len = ft_strlen(src);
if (dstsize < dest_len)
return (src_len + dstsize);
dst += dest_len;
ft_strlcpy(dst, src, dstsize - dest_len);
return (src_len + dest_len);
}