-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathft_strncat.c
More file actions
26 lines (23 loc) · 1.07 KB
/
ft_strncat.c
File metadata and controls
26 lines (23 loc) · 1.07 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
26
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strncat.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: wbeets <wbeets@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/03/20 11:57:17 by wbeets #+# #+# */
/* Updated: 2015/03/20 11:57:17 by wbeets ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strncat(char *s1, const char *s2, size_t n)
{
int i;
int j;
i = 0;
j = ft_strlen(s1);
while (n-- && s2[i] != '\0')
s1[j++] = s2[i++];
s1[j] = '\0';
return (s1);
}