summaryrefslogtreecommitdiffstats
path: root/src/c_init.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-12-18 16:38:46 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-12-18 16:38:46 +0100
commit798899df9da337ff47a8fb69403009c316f01e7d (patch)
treecad13885ea0f70f0a39b9d200b778ca14776b8f6 /src/c_init.c
parentCommit (diff)
parentnormagain (diff)
download42-minishell-798899df9da337ff47a8fb69403009c316f01e7d.tar.gz
42-minishell-798899df9da337ff47a8fb69403009c316f01e7d.tar.bz2
42-minishell-798899df9da337ff47a8fb69403009c316f01e7d.tar.xz
42-minishell-798899df9da337ff47a8fb69403009c316f01e7d.tar.zst
42-minishell-798899df9da337ff47a8fb69403009c316f01e7d.zip
Merge branch 'leaktarace' of jozanleclerc.xyz:42-minishell into leaktarace
Diffstat (limited to 'src/c_init.c')
-rw-r--r--src/c_init.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/c_init.c b/src/c_init.c
index cea3cce..c5c2dea 100644
--- a/src/c_init.c
+++ b/src/c_init.c
@@ -72,7 +72,7 @@ static short
return (c_ctrl_l(line, tcaps, msh));
else if ((*((unsigned int *)buf)) == CTRL_D &&
line[0] == '\0')
- return (c_ctrl_d(msh));
+ return (c_ctrl_d(line, msh));
return (0);
}
@@ -125,7 +125,7 @@ char
static char
*c_process_key(char **line, char *buf, t_caps *tcaps, t_msh *msh)
{
- if (ft_isprint(buf[0]))
+ if (ft_isprint(buf[0]) && *line != NULL)
c_add_char(line, buf, tcaps);
else if (((*((unsigned int *)buf)) == UP_K) ||
((*((unsigned int *)buf)) == CTRL_P) ||