-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_strjoin.c
More file actions
22 lines (19 loc) · 1.09 KB
/
ft_strjoin.c
File metadata and controls
22 lines (19 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strjoin.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bwebb <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/06/03 15:28:48 by bwebb #+# #+# */
/* Updated: 2019/06/06 17:44:59 by bwebb ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strjoin(char const *s1, char const *s2)
{
char *ptr;
if ((!s1 || !s2) || !(ptr = ft_strnew(ft_strlen(s1) + ft_strlen(s2))))
return (NULL);
return (ft_strcat(ft_strcpy(ptr, s1), s2));
}