fix: env filler variable do not exist cause invalid read
This commit is contained in:
parent
6090784c02
commit
7bec120312
@ -6,7 +6,7 @@
|
||||
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/02/16 16:29:08 by cchauvet #+# #+# */
|
||||
/* Updated: 2023/02/16 17:49:03 by cchauvet ### ########.fr */
|
||||
/* Updated: 2023/02/17 13:41:51 by cchauvet ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -61,7 +61,6 @@ char *ft_env_filler(t_list **env, const char *str)
|
||||
if (value == NULL)
|
||||
return (NULL);
|
||||
temp = ft_strreplace(out, value, i, y);
|
||||
i = i + ft_strlen(value) - 1;
|
||||
free(out);
|
||||
if (temp == NULL)
|
||||
{
|
||||
@ -70,7 +69,8 @@ char *ft_env_filler(t_list **env, const char *str)
|
||||
}
|
||||
out = temp;
|
||||
}
|
||||
i++;
|
||||
if (out[i] != '\0')
|
||||
i++;
|
||||
}
|
||||
return (out);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user