diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-16 19:56:38 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-16 19:56:38 +0200 |
commit | e32a79f56d5121bbdcde45f3c2b4f1089fa328e1 (patch) | |
tree | 1a29db13a9e28a424a08e1751625ceb9d55b380c /src | |
parent | In progress (diff) | |
download | 42-minishell-e32a79f56d5121bbdcde45f3c2b4f1089fa328e1.tar.gz 42-minishell-e32a79f56d5121bbdcde45f3c2b4f1089fa328e1.tar.bz2 42-minishell-e32a79f56d5121bbdcde45f3c2b4f1089fa328e1.tar.xz 42-minishell-e32a79f56d5121bbdcde45f3c2b4f1089fa328e1.tar.zst 42-minishell-e32a79f56d5121bbdcde45f3c2b4f1089fa328e1.zip |
Still in progress
Diffstat (limited to 'src')
-rw-r--r-- | src/m_prompt.c | 2 | ||||
-rw-r--r-- | src/s_init.c | 1 | ||||
-rw-r--r-- | src/s_struct.h | 2 |
3 files changed, 3 insertions, 2 deletions
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; |