-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strncat.c
executable file
·32 lines (29 loc) · 1.1 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
31
32
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strncat.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: achambon <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/25 14:12:15 by achambon #+# #+# */
/* Updated: 2016/12/02 14:06:32 by achambon ### ########.fr */
/* */
/* ************************************************************************** */
#include <string.h>
#include "libft.h"
char *ft_strncat(char *s1, const char *s2, size_t n)
{
int i;
int j;
j = 0;
i = ft_strlen(s1);
while (j < n && *s2)
{
s1[i] = *s2;
i++;
s2++;
j++;
}
s1[i] = '\0';
return (s1);
}