]> git.dkaiser.de - 42/minishell.git/commitdiff
fixed *tmp and added libft in env header
authorChristopher Uhlig <chuhlig@1-C-5.42heilbronn.de>
Thu, 17 Oct 2024 13:48:50 +0000 (15:48 +0200)
committerChristopher Uhlig <chuhlig@1-C-5.42heilbronn.de>
Thu, 17 Oct 2024 13:48:50 +0000 (15:48 +0200)
include/env.h
src/env.c

index 5a6533387339d930e4fc00cd87b7268d177f1435..e7740027fd5642166c1b0270d02318904defd58e 100644 (file)
@@ -6,10 +6,12 @@
 /*   By: chuhlig <chuhlig@student.42.fr>            +#+  +:+       +#+        */
 /*                                                +#+#+#+#+#+   +#+           */
 /*   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;
index 8105bf42e915933606f3356e2f7202d1fc3bdaef..c71b2cbfe3a3083381205caec326846c610d24f1 100644 (file)
--- a/src/env.c
+++ b/src/env.c
@@ -6,7 +6,7 @@
 /*   By: chuhlig <chuhlig@student.42.fr>            +#+  +:+       +#+        */
 /*                                                +#+#+#+#+#+   +#+           */
 /*   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]);