summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-09-11 15:15:22 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-09-11 15:15:22 +0200
commita0f1c28e809f036ebb06d9c017aceef032139316 (patch)
tree72c779150251ce921940fa0eaec23e029c07cd68
parentFix (diff)
download42-minishell-a0f1c28e809f036ebb06d9c017aceef032139316.tar.gz
42-minishell-a0f1c28e809f036ebb06d9c017aceef032139316.tar.bz2
42-minishell-a0f1c28e809f036ebb06d9c017aceef032139316.tar.xz
42-minishell-a0f1c28e809f036ebb06d9c017aceef032139316.tar.zst
42-minishell-a0f1c28e809f036ebb06d9c017aceef032139316.zip
Huge fix
-rw-r--r--src/p_lblock_next.c3
1 files changed, 2 insertions, 1 deletions
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);
}