summaryrefslogtreecommitdiffstats
path: root/src/ft_s_init.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-20 16:48:19 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-20 16:48:19 +0200
commit86382acdb6cc8a94f98f4d8fe8d60f24b13fdebe (patch)
treee9c89ec16372d95bf10e96e6707d2258b0ea1b68 /src/ft_s_init.c
parentUpdate (diff)
download42-minishell-86382acdb6cc8a94f98f4d8fe8d60f24b13fdebe.tar.gz
42-minishell-86382acdb6cc8a94f98f4d8fe8d60f24b13fdebe.tar.bz2
42-minishell-86382acdb6cc8a94f98f4d8fe8d60f24b13fdebe.tar.xz
42-minishell-86382acdb6cc8a94f98f4d8fe8d60f24b13fdebe.tar.zst
42-minishell-86382acdb6cc8a94f98f4d8fe8d60f24b13fdebe.zip
Good
Diffstat (limited to '')
-rw-r--r--src/ft_s_init.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/ft_s_init.c b/src/ft_s_init.c
index 103725b..0d27aa7 100644
--- a/src/ft_s_init.c
+++ b/src/ft_s_init.c
@@ -10,10 +10,12 @@
/* */
/* ************************************************************************** */
-#include <ft_s_init.h>
+#include <libft.h>
+#include "ft_d_define.h"
+#include "ft_s_init.h"
t_msh
-*ft_init_msh(void)
+ *ft_init_msh(void)
{
t_msh *msh;
@@ -21,6 +23,12 @@ t_msh
{
return (NULL);
}
+ if (!(msh->ps_one =
+ (char*)malloc((ft_strlen(FT_PS_ONE) + 1) * sizeof(char))))
+ {
+ return (NULL);
+ }
+ ft_strlcpy(msh->ps_one, FT_PS_ONE, ft_strlen(FT_PS_ONE));
msh->envp = NULL;
msh->lcom = NULL;
return (msh);