-
Notifications
You must be signed in to change notification settings - Fork 2
/
ft_strlcat.c
29 lines (26 loc) · 1.12 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strlcat.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: hbaddrul <hbaddrul@student.42kl.edu.my> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/04/29 14:59:22 by hbaddrul #+# #+# */
/* Updated: 2021/07/30 16:30:49 by hbaddrul ### ########.fr */
/* */
/* ************************************************************************** */
#include <stddef.h>
#include "libft.h"
size_t ft_strlcat(char *dst, const char *src, size_t dstsize)
{
size_t i;
size_t ret;
i = 0;
while (*dst && i < dstsize)
{
++dst;
++i;
}
ret = ft_strlcpy(dst, src, dstsize - i);
return (ret + i);
}