-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathft_strlcat.c
More file actions
29 lines (26 loc) · 1.19 KB
/
ft_strlcat.c
File metadata and controls
29 lines (26 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
28
29
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strlcat.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dpoveda- <me@izenynn.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/09/17 17:47:10 by dpoveda- #+# #+# */
/* Updated: 2023/03/13 17:27:56 by dpoveda- ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft/ft_str.h"
size_t ft_strlcat(char *dst, const char *src,
size_t dstsize)
{
size_t d_len;
size_t s_len;
d_len = ft_strlen(dst);
s_len = ft_strlen(src);
dst += d_len;
if (dstsize > d_len)
ft_strlcpy(dst, src, dstsize - d_len);
if (dstsize < d_len)
return (s_len + dstsize);
return (d_len + s_len);
}