/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strjoin.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: tosuman +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/05/24 13:43:29 by tosuman #+# #+# */ /* Updated: 2023/05/24 13:43:30 by tosuman ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" char *ft_strjoin(char const *s1, char const s2) { size_t total_len; char *joined_str; total_len = ft_strlen(s1) + ft_strlen(s2); joined_str = ft_calloc(sizeof(char) * (total_len + 1)); if (!joined_str) return (0); ft_strlcpy(joined_str, s1, total_len); ft_strlcat(joined_str, s2, total_len); return (joined_str); }