-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strjoin_free.c
executable file
·31 lines (28 loc) · 1.15 KB
/
ft_strjoin_free.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strjoin_free.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jraymond <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/12/19 12:16:01 by jraymond #+# #+# */
/* Updated: 2018/07/02 01:15:52 by jraymond ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strjoin_free(char const *s1, char const *s2, int i)
{
char *result_join;
result_join = ft_strjoin(s1, s2);
if (i == 0 || i == 1)
{
free((void*)s1);
s1 = NULL;
}
if (i == 0 || i == 2)
{
free((void*)s2);
s2 = NULL;
}
return (result_join);
}