-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strjoinfree.c
25 lines (22 loc) · 1.11 KB
/
ft_strjoinfree.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strjoinfree.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jfortin <jfortin@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/08/11 14:11:22 by jfortin #+# #+# */
/* Updated: 2017/11/14 16:33:37 by jfortin ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strjoinfree(char *s1, char *s2, const char control)
{
char *out;
out = ft_strjoin(s1, s2);
if (control == 'L' || control == 'B')
free(s1);
if (control == 'R' || control == 'B')
free(s2);
return (out);
}