diff options
Diffstat (limited to 'ft_strjoin_free_snd.c')
| -rw-r--r-- | ft_strjoin_free_snd.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/ft_strjoin_free_snd.c b/ft_strjoin_free_snd.c index 46e36ae..0503211 100644 --- a/ft_strjoin_free_snd.c +++ b/ft_strjoin_free_snd.c @@ -6,7 +6,7 @@ /* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/11/05 22:12:56 by cacharle #+# #+# */ -/* Updated: 2019/11/05 22:17:15 by cacharle ### ########.fr */ +/* Updated: 2019/11/14 10:07:19 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -19,11 +19,8 @@ char *ft_strjoin_free_snd(char const *s1, char const *s2) if (s1 == NULL || s2 == NULL) return (NULL); - if ((joined = (char*)malloc(sizeof(char) - * (ft_strlen(s1) + ft_strlen(s2) + 1))) == NULL) + if ((joined = ft_strjoin(s1, s2)) == NULL) return (NULL); - joined = ft_strcpy(joined, s1); - joined = ft_strcat(joined, s2); free((void*)s2); return (joined); } |
