From a0f1c28e809f036ebb06d9c017aceef032139316 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Fri, 11 Sep 2020 15:15:22 +0200 Subject: Huge fix --- src/p_lblock_next.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/p_lblock_next.c') diff --git a/src/p_lblock_next.c b/src/p_lblock_next.c index e342f4a..e5e46dc 100644 --- a/src/p_lblock_next.c +++ b/src/p_lblock_next.c @@ -61,7 +61,7 @@ static char ft_strlcpy(tmp, ptr + i, varlen + 1 - i); u_get_var_value(varval, tmp, ARG_MAX, msh); p_double_them_bs(varval); - ft_strlcpy(tmp, ptr + varlen, varlen + 1); + ft_strlcpy(tmp, ptr + varlen, ft_strlen(ptr + varlen) + 1); if ((word = ft_nrealloc(word, i, i + ft_strlen(varval) + ft_strlen(tmp) + 1)) == NULL) return (NULL); @@ -69,6 +69,7 @@ static char ft_strlcpy(word + (i + ft_strlen(varval)), tmp, ft_strlen(tmp) + 1); count = 0; *(p) = word + (i + ft_strlen(varval) - 1); + ft_printf("[%s]\n", word); return (word); } -- cgit v1.2.3