From 831aa4a82679290e89cc2b4405c6c12985b3451b Mon Sep 17 00:00:00 2001 From: salad Date: Tue, 28 Apr 2020 19:22:21 +0200 Subject: simple really --- src/ft_m_loop.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ft_m_loop.c b/src/ft_m_loop.c index 2280cfd..1797c93 100644 --- a/src/ft_m_loop.c +++ b/src/ft_m_loop.c @@ -24,6 +24,7 @@ uint8_t ft_m_loop_cont(t_msh *msh, char *line, char *quote) { int8_t gnl; + size_t len; char *prog; char *buf; char *fin; @@ -37,6 +38,8 @@ uint8_t { ft_m_cont_prompt(); gnl = get_next_line(STDIN_FILENO, &line); + len = ft_strlen(buf); + buf = ft_nrealloc(buf, len, (len + ft_strlen(line))); ft_sprintf(buf + ft_strlen(buf), "\n%s", line); } buf = ft_strtrim(buf, "\"'"); -- cgit v1.2.3