This commit is contained in:
kinou-p 2020-12-13 22:12:32 +01:00
parent 7929de9c89
commit 463d8fb108

View File

@ -6,7 +6,7 @@
/* By: apommier <alexpomms@student.42.fr> +#+ +:+ +#+ */ /* By: apommier <alexpomms@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2020/12/07 00:54:12 by apommier #+# #+# */ /* Created: 2020/12/07 00:54:12 by apommier #+# #+# */
/* Updated: 2020/12/13 22:07:53 by apommier ### ########.fr */ /* Updated: 2020/12/13 22:12:26 by apommier ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -63,10 +63,10 @@ char **ft_split(char const *s, char c)
return (0); return (0);
while (s[i]) while (s[i])
{ {
while (s[i] == c && s[i]) while (s[i] != c && s[i])
i++; i++;
j++; j++;
while (s[i] != c && s[i]) while (s[i] == c && s[i])
i++; i++;
} }
if (!(dest = (char**)malloc(sizeof(char*) * j)))) if (!(dest = (char**)malloc(sizeof(char*) * j))))