-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strlcat.c
38 lines (31 loc) · 1.3 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
27
28
29
30
31
32
33
34
35
36
37
38
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strlcat.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dpaluszk <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/07 15:00:58 by dpaluszk #+# #+# */
/* Updated: 2024/03/19 10:21:48 by dpaluszk ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
size_t ft_strlcat(char *dst, const char *src, size_t dstsize)
{
size_t i;
size_t result;
i = 0;
while (dst[i] != '\0' && i < dstsize)
i++;
result = ft_strlcpy(&dst[i], src, dstsize - i);
return (result + i);
}
// int main()
//{
// char dest[20] = "hello, ";
// char src[] = "world!";
// size_t len = sizeof(dest);
// ft_strlcat(dest, src, 14);
// printf("%s\n", dest);
// return (0);
//}