summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ft_m_loop.c3
1 files changed, 3 insertions, 0 deletions
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, "\"'");