From e32a79f56d5121bbdcde45f3c2b4f1089fa328e1 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Wed, 16 Sep 2020 19:56:38 +0200 Subject: Still in progress --- src/m_prompt.c | 2 +- src/s_init.c | 1 + src/s_struct.h | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/m_prompt.c b/src/m_prompt.c index 584a98d..5278c42 100644 --- a/src/m_prompt.c +++ b/src/m_prompt.c @@ -99,7 +99,7 @@ static void return ; } m_subst_prompt_rice(var, msh); - ft_strlcpy(msh->ps[x - 1], var, ft_strlen(var) + 1); + ft_strlcpy(msh->ps[x - 1], var, 255); } void diff --git a/src/s_init.c b/src/s_init.c index b229cda..58f0cca 100644 --- a/src/s_init.c +++ b/src/s_init.c @@ -176,6 +176,7 @@ t_msh msh->pipes = NULL; msh->vars = NULL; msh->alias = NULL; + msh->prev_hist = NULL; set_cwd(cwd, msh); if ((msh->cwd = ft_strdup(cwd)) == NULL) return (NULL); diff --git a/src/s_struct.h b/src/s_struct.h index 31313bf..b9668de 100644 --- a/src/s_struct.h +++ b/src/s_struct.h @@ -82,7 +82,7 @@ typedef struct s_msh struct s_lalias *alias; char **envp; char **prev_hist; - char ps[4][1024]; + char ps[4][255]; char env_fork_tmp[128][4096]; char sqb_ref[FT_ID_SQB_COUNT][4]; char *shname; -- cgit v1.2.3