-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathft_join_quote.c
26 lines (23 loc) · 1.11 KB
/
ft_join_quote.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_join_quote.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: olyuboch <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/10/03 16:40:29 by olyuboch #+# #+# */
/* Updated: 2017/10/03 16:40:31 by olyuboch ### ########.fr */
/* */
/* ************************************************************************** */
#include "shell.h"
char *ft_join_quote(char *a, char *b)
{
char *res;
res = malloc(ft_strlen(a) + 1 + ft_strlen(b ? b : "") + 1);
ft_strcpy(res, a);
ft_strcat(res, "\n");
ft_strcat(res, b ? b : "");
free(a);
free(b);
return (res);
}