-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_strlcat.c
More file actions
25 lines (22 loc) · 1.14 KB
/
ft_strlcat.c
File metadata and controls
25 lines (22 loc) · 1.14 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strlcat.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: loram <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/09/12 22:50:19 by loram #+# #+# */
/* Updated: 2019/09/12 23:44:08 by loram ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
size_t ft_strlcat(char *restrict dst, const char *restrict src, size_t size)
{
size_t len;
len = ft_strlen(dst);
if (size > len)
ft_strncat(dst, src, (size - len - 1));
if (size < len)
return (size + ft_strlen(src));
return (len + ft_strlen(src));
}