From 9af2885d872de9c60b11159efe0685738031096d Mon Sep 17 00:00:00 2001 From: Charles Date: Fri, 14 Feb 2020 03:46:08 +0100 Subject: Added documentation for all functions and refactored ft_strjoin_free -> ft_strjoinf --- src/str/ft_strjoin.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/str/ft_strjoin.c') diff --git a/src/str/ft_strjoin.c b/src/str/ft_strjoin.c index 2bc4908..b65eaa2 100644 --- a/src/str/ft_strjoin.c +++ b/src/str/ft_strjoin.c @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/10/07 10:35:26 by cacharle #+# #+# */ -/* Updated: 2019/11/20 04:02:20 by cacharle ### ########.fr */ +/* Updated: 2020/02/14 03:40:39 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -18,7 +18,8 @@ char *ft_strjoin(char const *s1, char const *s2) if (s1 == NULL || s2 == NULL) return (NULL); - if ((joined = ft_strnew(ft_strlen(s1) + ft_strlen(s2))) == NULL) + if ((joined = (char*)malloc(sizeof(char) + * (ft_strlen(s1) + ft_strlen(s2) + 1))) == NULL) return (NULL); return (ft_strcat(ft_strcpy(joined, s1), s2)); } -- cgit