-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strjoin_modified.c
33 lines (30 loc) · 1.16 KB
/
ft_strjoin_modified.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
33
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strjoin.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: vsosevic <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/01 19:30:40 by vsosevic #+# #+# */
/* Updated: 2016/12/01 19:53:21 by vsosevic ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
char *ft_strjoin_m(char *s1, char const *s2)
{
char *str;
size_t len;
str = NULL;
if (s1 && s2)
{
len = ft_strlen(s1) + ft_strlen(s2);
str = (char *)malloc(len + 1);
if (str)
{
ft_strcpy(str, s1);
ft_strcat(str, s2);
}
}
free(s1);
return (str);
}