From 0cf7761bf2985f683b1b73dfe5bdb731672e2b7f Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 21 Oct 2019 20:25:32 +0200 Subject: Added protection on part2 and changed lstmap according to the subject --- ft_strjoin.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ft_strjoin.c') diff --git a/ft_strjoin.c b/ft_strjoin.c index a282c53..0078d65 100644 --- a/ft_strjoin.c +++ b/ft_strjoin.c @@ -17,6 +17,8 @@ char *ft_strjoin(char const *s1, char const *s2) { char *joined; + if (s1 == NULL || s2 == NULL) + return (NULL); if ((joined = (char*)malloc(sizeof(char) * (ft_strlen(s1) + ft_strlen(s2) + 1))) == NULL) return (NULL); -- cgit