aboutsummaryrefslogtreecommitdiff
path: root/ft_split.c
diff options
context:
space:
mode:
Diffstat (limited to 'ft_split.c')
-rw-r--r--ft_split.c2
1 files changed, 2 insertions, 0 deletions
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);