From d05140c9c6bacce28b37124fbda48ea3a39ac486 Mon Sep 17 00:00:00 2001 From: Christopher Uhlig Date: Thu, 17 Oct 2024 15:48:50 +0200 Subject: [PATCH] fixed *tmp and added libft in env header --- include/env.h | 4 +++- src/env.c | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/env.h b/include/env.h index 5a65333..e774002 100644 --- a/include/env.h +++ b/include/env.h @@ -6,10 +6,12 @@ /* By: chuhlig +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/08/08 16:53:39 by dkaiser #+# #+# */ -/* Updated: 2024/10/17 15:37:32 by chuhlig ### ########.fr */ +/* Updated: 2024/10/17 15:47:30 by chuhlig ### ########.fr */ /* */ /* ************************************************************************** */ +#include "libft.h" + typedef struct s_env { char *name; diff --git a/src/env.c b/src/env.c index 8105bf4..c71b2cb 100644 --- a/src/env.c +++ b/src/env.c @@ -6,7 +6,7 @@ /* By: chuhlig +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/10/17 14:31:07 by chuhlig #+# #+# */ -/* Updated: 2024/10/17 15:18:44 by chuhlig ### ########.fr */ +/* Updated: 2024/10/17 15:47:11 by chuhlig ### ########.fr */ /* */ /* ************************************************************************** */ @@ -22,7 +22,7 @@ void getenvlst(t_env **env, char **en) while (en[i] != NULL) { tmp = ft_strchr(en[i], '='); - tmp = '\0'; + *tmp = '\0'; current = *env; current = malloc(sizeof(t_env)); current->name = ft_strdup(en[i]); -- 2.47.2