diff options
| author | Charles <sircharlesaze@gmail.com> | 2019-10-21 20:25:32 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2019-10-21 20:25:32 +0200 |
| commit | 0cf7761bf2985f683b1b73dfe5bdb731672e2b7f (patch) | |
| tree | 3aff24216409fa5ac313b2ff686f3e23ba9493ff /ft_split.c | |
| parent | 70a7a3a54d4e300c7ec75d18d14d6d6b174c9ee4 (diff) | |
| download | libft-0cf7761bf2985f683b1b73dfe5bdb731672e2b7f.tar.gz libft-0cf7761bf2985f683b1b73dfe5bdb731672e2b7f.tar.bz2 libft-0cf7761bf2985f683b1b73dfe5bdb731672e2b7f.zip | |
Added protection on part2 and changed lstmap according to the subject
Diffstat (limited to 'ft_split.c')
| -rw-r--r-- | ft_split.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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); |
