fix(ft_strsplit): compile error
This commit is contained in:
parent
1ab0cdf1ac
commit
88ac06645f
|
@ -47,10 +47,12 @@ static void *ft_taballoc(char const *s, char **str_tab, char c)
|
|||
wl++;
|
||||
i++;
|
||||
}
|
||||
if (wl != 0)
|
||||
*str_tab++ = (char *)malloc((wl + 1) * sizeof(char));
|
||||
if (!(str_tab - 1))
|
||||
if (wl != 0) {
|
||||
*str_tab = (char *)malloc((wl + 1) * sizeof(char));
|
||||
if (!str_tab)
|
||||
return (NULL);
|
||||
str_tab++;
|
||||
}
|
||||
}
|
||||
return (*str_tab);
|
||||
}
|
||||
|
@ -83,3 +85,4 @@ char **ft_strsplit(char const *s, char c)
|
|||
str_tab[i] = NULL;
|
||||
return (str_tab);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue