From a4fb6efe7aa29fad4483ad31909afd67854fd464 Mon Sep 17 00:00:00 2001 From: salad Date: Tue, 28 Apr 2020 18:37:12 +0200 Subject: nothing of value was lost --- heh | 3 +++ qwe.salut | 1 + sa.lut | 1 + src/ft_m_loop.c | 7 ++++--- 4 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 heh create mode 100644 qwe.salut create mode 100644 sa.lut diff --git a/heh b/heh new file mode 100644 index 0000000..3de6e45 --- /dev/null +++ b/heh @@ -0,0 +1,3 @@ +salut +les +potes ' diff --git a/qwe.salut b/qwe.salut new file mode 100644 index 0000000..74a42cf --- /dev/null +++ b/qwe.salut @@ -0,0 +1 @@ +qwe" diff --git a/sa.lut b/sa.lut new file mode 100644 index 0000000..e62415c --- /dev/null +++ b/sa.lut @@ -0,0 +1 @@ +qwe diff --git a/src/ft_m_loop.c b/src/ft_m_loop.c index 7c6259c..2280cfd 100644 --- a/src/ft_m_loop.c +++ b/src/ft_m_loop.c @@ -30,8 +30,6 @@ uint8_t if (!(prog = ft_calloc(ft_strlen(line + 1), sizeof(char)))) return (0); - if (!(fin = malloc((ft_strlen(prog) + ft_strlen(buf)) * sizeof(char)))) - return (0); ft_memcpy(prog, line, (quote - line)); buf = ft_strdup(line + (quote - line) + 1); gnl = 1; @@ -42,14 +40,17 @@ uint8_t ft_sprintf(buf + ft_strlen(buf), "\n%s", line); } buf = ft_strtrim(buf, "\"'"); + if (!(fin = malloc((ft_strlen(prog) + ft_strlen(buf)) * sizeof(char)))) + return (0); fin = ft_strjoin(prog, buf); ft_p_line(fin, msh); ft_memdel((void*)&line); ft_memdel((void*)&buf); ft_memdel((void*)&fin); + ft_memdel((void*)&prog); ft_e_lcom(msh); ft_lcom_clear(&msh->curr); - return (1); /*got second quote, keep going*/ + return (1); } uint8_t -- cgit v1.2.3