From 4b233e06a16bf5183223e8253b4d9ac9ee59e6a2 Mon Sep 17 00:00:00 2001
From: JozanLeClerc <bousset.rudy@gmail.com>
Date: Mon, 10 Aug 2020 17:56:38 +0200
Subject: Work in progress

---
 src/b_export_next.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

(limited to 'src/b_export_next.c')

diff --git a/src/b_export_next.c b/src/b_export_next.c
index 7b70047..90a4820 100644
--- a/src/b_export_next.c
+++ b/src/b_export_next.c
@@ -28,17 +28,17 @@ static char
 	char	**var;
 
 	if ((var = (char**)malloc(3 * sizeof(char*))) == NULL)
-		f_fail_alloc_and_destroy(msh);
+		f_alloc_and_destroy_msh(msh);
 	len = 0;
 	while (arg[len] != '=' && arg[len] != '\0')
 		len++;
 	len += 1;
 	if ((var[FT_VAR_NAME] = (char*)malloc((len + 1) * sizeof(char))) == NULL)
-		f_fail_alloc_and_destroy(msh);
+		f_alloc_and_destroy_msh(msh);
 	var[FT_VAR_NAME][0] = '$';
 	ft_strlcpy(var[FT_VAR_NAME] + 1, arg, len);
 	if ((var[FT_VAR_VAL] = ft_strdup(arg + len)) == NULL)
-		f_fail_alloc_and_destroy(msh);
+		f_alloc_and_destroy_msh(msh);
 	var[FT_VAR_NULL] = NULL;
 	return (var);
 }
@@ -75,16 +75,16 @@ static void
 	while (msh->envp[i] != NULL)
 		i++;
 	if (!(nenvp = (char**)malloc((i + 2) * sizeof(char*))))
-		f_fail_alloc_and_destroy(msh);
+		f_alloc_and_destroy_msh(msh);
 	i = 0;
 	while (msh->envp[i] != NULL)
 	{
 		if (!(nenvp[i] = ft_strdup(msh->envp[i])))
-			f_fail_alloc_and_destroy(msh);
+			f_alloc_and_destroy_msh(msh);
 		i++;
 	}
 	if (!(nenvp[i] = ft_strdup(arg)))
-		f_fail_alloc_and_destroy(msh);
+		f_alloc_and_destroy_msh(msh);
 	nenvp[i + 1] = 0;
 	ft_delwords(msh->envp);
 	msh->envp = nenvp;
@@ -103,7 +103,7 @@ void
 	{
 		ft_memdel((void*)&msh->envp[env_i]);
 		if ((msh->envp[env_i] = ft_strdup(arg)) == NULL)
-			f_fail_alloc_and_destroy(msh);
+			f_alloc_and_destroy_msh(msh);
 	}
 	else if ((varval = u_get_cstm_vr(var[FT_VAR_NAME], msh)) != NULL)
 	{
-- 
cgit v1.2.3