-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strlcat.c
26 lines (23 loc) · 1.17 KB
/
ft_strlcat.c
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strlcat.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gialexan <gialexan@student.42sp.org.br> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/06/17 22:02:24 by gialexan #+# #+# */
/* Updated: 2022/06/20 19:31:35 by gialexan ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
size_t ft_strlcat(char *dst, const char *src, size_t dstsize)
{
size_t len_dst;
size_t len_src;
len_dst = ft_strlen(dst);
len_src = ft_strlen(src);
if (dstsize < len_dst)
return (len_src + dstsize);
ft_strlcpy(dst + len_dst, src, dstsize - len_dst);
return (len_dst + len_src);
}