-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_strjoin.c
More file actions
30 lines (27 loc) · 1.14 KB
/
Copy pathft_strjoin.c
File metadata and controls
30 lines (27 loc) · 1.14 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
27
28
29
30
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strjoin.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: vbraeke <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/11/28 22:45:49 by vbraeke #+# #+# */
/* Updated: 2016/01/07 16:28:58 by vbraeke ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strjoin(char const *s1, char const *s2)
{
char *fresh;
if (s1 && s2)
{
fresh = ft_strnew(ft_strlen(s1) + ft_strlen(s2));
if (fresh)
{
ft_strcpy(fresh, (char *)s1);
ft_strcat(fresh, s2);
return (fresh);
}
}
return (NULL);
}