corrected env -i crash & SHLVL

This commit is contained in:
Tanguy Maze
2020-01-28 13:38:25 +01:00
parent 40718a99ac
commit 25c4b28f4c
7 changed files with 82 additions and 31 deletions

View File

@@ -17,7 +17,7 @@ char *ft_envtochar(t_env *env)
int size;
char *ret;
size = ft_strlen(env->key) + ft_strlen(env->val) + 1;
size = ft_strlen(env->key) + ft_strlen(env->val) + 2;
if ((ret = ft_strnew(size)) != NULL)
{
ft_strlcpy(ret, env->key, size);