-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_strjoin.c
More file actions
29 lines (26 loc) · 1.14 KB
/
Copy pathft_strjoin.c
File metadata and controls
29 lines (26 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strjoin.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tbenedic <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/06/10 16:37:20 by tbenedic #+# #+# */
/* Updated: 2018/06/14 17:48:01 by tbenedic ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
#include <stdlib.h>
char *ft_strjoin(char const *s1, char const *s2)
{
char *ss1;
char *ss2;
if (!s1 || !s2)
return (0);
if (!(ss1 = ft_strdup(s1)))
return (0);
if (!(ss2 = ft_strdup(s2)))
return (0);
ft_strcat(ss1, ss2);
return (ss1);
}