summaryrefslogtreecommitdiffstats
path: root/src/c_init.c
diff options
context:
space:
mode:
authorsalad <fmoenne-@student.le-101.fr>2020-11-05 17:40:52 +0100
committersalad <fmoenne-@student.le-101.fr>2020-11-05 17:40:52 +0100
commit2dbcdc9fbe10f7bc6eb019b0dcb5ac138b3f8371 (patch)
tree44a54efb3a1af9531839d55f06b9fc5c8af51de5 /src/c_init.c
parentplen fixed (diff)
download42-minishell-2dbcdc9fbe10f7bc6eb019b0dcb5ac138b3f8371.tar.gz
42-minishell-2dbcdc9fbe10f7bc6eb019b0dcb5ac138b3f8371.tar.bz2
42-minishell-2dbcdc9fbe10f7bc6eb019b0dcb5ac138b3f8371.tar.xz
42-minishell-2dbcdc9fbe10f7bc6eb019b0dcb5ac138b3f8371.tar.zst
42-minishell-2dbcdc9fbe10f7bc6eb019b0dcb5ac138b3f8371.zip
C-c arrows
Diffstat (limited to 'src/c_init.c')
-rw-r--r--src/c_init.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/c_init.c b/src/c_init.c
index 1cc31b0..d80b9ea 100644
--- a/src/c_init.c
+++ b/src/c_init.c
@@ -121,20 +121,20 @@ short
c_gnl(int fd, char **line, char psx, t_msh *msh)
{
t_caps tcaps;
- char nread[5];
+ char nread[4];
c_init_line(psx, &tcaps);
tputs(tgetstr("cr", NULL), 1, ft_putchar);
m_prompt_psx(psx, msh);
- ft_bzero(nread, 5);
+ ft_bzero(nread, 4);
tcaps.plen = (unsigned int)m_plen(msh->ps[psx - 1]);
tcaps.plen += (psx != 1);
if (!(c_get_win_size(&tcaps.ws)))
return (-1);
while (!(ft_strchr(nread, '\n')))
{
- ft_bzero(nread, 5);
- if (!(read(fd, nread, 4)))
+ ft_bzero(nread, 4);
+ if (!(read(fd, nread, 3)))
return (0);
else
*line = c_process_key(nread, &tcaps, msh);