protect empty env

This commit is contained in:
Tanguy MAZE 2020-02-07 15:12:10 +01:00
parent f0837247bd
commit e550d2bb37

View File

@ -6,7 +6,7 @@
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/09/19 17:08:46 by tmaze #+# #+# */
/* Updated: 2020/02/01 15:54:34 by tmaze ### ########.fr */
/* Updated: 2020/02/07 15:11:58 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
@ -32,7 +32,7 @@ t_env *env2lst(char **env)
i = 0;
ret = NULL;
while (env[i])
while (env && env[i])
{
if ((new = ft_envnew(env[i])) != NULL)
{