summaryrefslogtreecommitdiffstats
path: root/src/p_lcom_next.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-09-06 22:02:47 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-09-06 22:02:47 +0200
commit1f867b196a83d0aeaf67d431a0fc5271e01a310e (patch)
tree4c4e38933074fc35798132906d8325b9042abe5c /src/p_lcom_next.c
parentStacked (diff)
download42-minishell-1f867b196a83d0aeaf67d431a0fc5271e01a310e.tar.gz
42-minishell-1f867b196a83d0aeaf67d431a0fc5271e01a310e.tar.bz2
42-minishell-1f867b196a83d0aeaf67d431a0fc5271e01a310e.tar.xz
42-minishell-1f867b196a83d0aeaf67d431a0fc5271e01a310e.tar.zst
42-minishell-1f867b196a83d0aeaf67d431a0fc5271e01a310e.zip
Cool
Diffstat (limited to 'src/p_lcom_next.c')
-rw-r--r--src/p_lcom_next.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/p_lcom_next.c b/src/p_lcom_next.c
index 7bc306e..7ae0331 100644
--- a/src/p_lcom_next.c
+++ b/src/p_lcom_next.c
@@ -65,11 +65,11 @@ static char
varlen += 1;
ft_strlcpy(tmp, ptr + i, varlen + 1 - i);
u_get_var_value(varval, tmp, 4096, msh);
- ft_strlcpy(tmp, ptr + varlen + 1, varlen);
+ ft_strlcpy(tmp, ptr + varlen, varlen);
word = ft_nrealloc(word, i, i + ft_strlen(varval) + ft_strlen(tmp) + 1);
ft_strlcpy(word + i, varval, ft_strlen(varval) + 1);
- ft_printf("[%s]\n", tmp);
ft_strlcpy(word + i + ft_strlen(varval), tmp, ft_strlen(tmp) + 1);
+ ft_printf("[%s]\n", word);
exit(0);
return (word);
}