26 lines
1.1 KiB
C
26 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_strjoin.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2016/11/03 14:58:18 by jhalford #+# #+# */
|
|
/* Updated: 2017/11/10 18:03:04 by jhalford ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libft.h"
|
|
|
|
char *ft_strjoin(char const *s1, char const *s2)
|
|
{
|
|
char *join;
|
|
|
|
if (!(join = ft_strnew(ft_strlen(s1) + ft_strlen(s2) + 1)))
|
|
return (NULL);
|
|
if (s1)
|
|
ft_strcpy(join, s1);
|
|
if (s2)
|
|
ft_strcat(join, s2);
|
|
return (join);
|
|
}
|