From c8e857173d2879e9a55085384fe5978370a11c57 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Mon, 27 Apr 2020 15:39:14 +0200 Subject: Variables fixed --- src/ft_p_lcom_next.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/ft_p_lcom_next.c') diff --git a/src/ft_p_lcom_next.c b/src/ft_p_lcom_next.c index 272931d..c4666f4 100644 --- a/src/ft_p_lcom_next.c +++ b/src/ft_p_lcom_next.c @@ -39,9 +39,8 @@ char varlen = i + 1; while ((*p_words)[varlen] != '\0' && (*p_words)[varlen] != '$') varlen += 1; - if (!(s_varname = ft_substr(*p_words, (uint32_t)i, varlen))) + if (!(s_varname = ft_substr(*p_words, (uint32_t)i, varlen - i))) return (NULL); - ft_printf("a\n"); varval = ft_subst_var_value(s_varname, msh); *p_words = ft_strsubst(*p_words, s_varname, varval); ft_memdel((void*)&s_varname); -- cgit v1.2.3