-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathft_freestrjoin.c
25 lines (22 loc) · 1.08 KB
/
ft_freestrjoin.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_freestrjoin.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: vbrazas <vbrazas@student.unit.ua> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/02/16 18:56:26 by vbrazas #+# #+# */
/* Updated: 2019/02/16 18:56:55 by vbrazas ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
bool ft_freestrjoin(char **dst, const char *source)
{
char *tmp;
if (!dst || !*dst || !source)
return (false);
tmp = *dst;
*dst = ft_strjoin(*dst, source);
free(tmp);
return (true);
}