-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strcat.c
29 lines (26 loc) · 1.08 KB
/
ft_strcat.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_strcat.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ohachim <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/10/07 13:51:23 by ohachim #+# #+# */
/* Updated: 2018/10/19 20:16:45 by ohachim ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strcat(char *s1, const char *s2)
{
int len;
int cn;
cn = 0;
len = ft_strlen(s1);
while (s2[cn] != '\0')
{
s1[len + cn] = s2[cn];
cn++;
}
s1[len + cn] = '\0';
return (s1);
}