-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strlcat.c
26 lines (23 loc) · 1.15 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: nben-yaa <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/06/25 18:28:28 by nben-yaa #+# #+# */
/* Updated: 2018/06/25 19:23:21 by nben-yaa ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
size_t ft_strlcat(char *dst, const char *src, size_t size)
{
size_t i;
size_t res;
i = ft_strlen(dst);
if (i >= size)
return (ft_strlen(src) + size);
res = ft_strlen(dst) + ft_strlen(src);
ft_strncat(dst, src, size - ft_strlen(dst) - 1);
return (res);
}