diff options
Diffstat (limited to '')
-rw-r--r-- | src/c_init.c | 8 |
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); |