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_split.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ft_split.c') diff --git a/ft_split.c b/ft_split.c index 62ba476..d4ceabf 100644 --- a/ft_split.c +++ b/ft_split.c @@ -68,6 +68,8 @@ char **ft_split(char const *s, char c) size_t i; size_t j; + if (s == NULL) + return (NULL); tab_counter = count_segment(s, c); if ((strs = (char**)malloc(sizeof(char*) * (tab_counter + 1))) == NULL) return (NULL); -- cgit