-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strncat.c
30 lines (27 loc) · 1.11 KB
/
ft_strncat.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strcat.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: akalombo <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/05/18 13:40:56 by akalombo #+# #+# */
/* Updated: 2019/06/22 04:59:15 by akalombo ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strncat(char *s1, const char *s2, size_t l)
{
size_t i;
size_t len;
len = ft_strlen(s1);
i = 0;
while (l > 0 && s2[i] != '\0')
{
s1[len + i] = s2[i];
i++;
l--;
}
s1[len + i] = '\0';
return (s1);
}