-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strncat.c
26 lines (23 loc) · 1.08 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strncat.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rnbou <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/10/06 20:32:43 by rnbou #+# #+# */
/* Updated: 2018/10/10 10:24:21 by rnbou ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strncat(char *s1, const char *s2, size_t n)
{
size_t l1;
size_t i;
l1 = ft_strlen(s1);
i = 0;
while (i < n && s2[i] != '\0')
s1[l1++] = s2[i++];
s1[l1] = '\0';
return (s1);
}