aboutsummaryrefslogtreecommitdiff
path: root/src/env.c
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-04-02 15:50:13 +0200
committerCharles <sircharlesaze@gmail.com>2020-04-03 08:57:45 +0200
commite5393671a265e1c301c6c303f21f938c4cf9ca75 (patch)
tree0190ff9ba762cf820b1846b01adc339092370e2c /src/env.c
parentf66cb8f28a2779159baeef6ea91a7684d59cc295 (diff)
downloadminishell-e5393671a265e1c301c6c303f21f938c4cf9ca75.tar.gz
minishell-e5393671a265e1c301c6c303f21f938c4cf9ca75.tar.bz2
minishell-e5393671a265e1c301c6c303f21f938c4cf9ca75.zip
Evaluation pipe frame (not tested)
Diffstat (limited to 'src/env.c')
-rw-r--r--src/env.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/env.c b/src/env.c
index 66b4994..631c2b4 100644
--- a/src/env.c
+++ b/src/env.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/28 09:21:24 by cacharle #+# #+# */
-/* Updated: 2020/04/01 23:09:33 by charles ### ########.fr */
+/* Updated: 2020/04/02 10:33:12 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -32,9 +32,9 @@ t_env env_from_array(char **envp)
while (envp[i] != NULL)
if (ft_strchr(envp[i++], '=') == NULL)
return (NULL);
- if ((env = ft_vecnew(i)) == NULL)
+ if ((env = ft_vecnew(i + 1)) == NULL)
return (NULL);
- env->size = i;
+ env->size = i + 1;
i = 0;
while (envp[i] != NULL)
{
@@ -45,6 +45,7 @@ t_env env_from_array(char **envp)
}
i++;
}
+ env->data[i] = NULL;
return (env);
}