diff options
Diffstat (limited to '')
-rw-r--r-- | src/ft_s_lcom.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/ft_s_lcom.c b/src/ft_s_lcom.c index 029a5c4..0f6f750 100644 --- a/src/ft_s_lcom.c +++ b/src/ft_s_lcom.c @@ -35,19 +35,19 @@ static int8_t break ; i++; } - if (!((*lcom)->args = (char**)malloc((i + 1) * sizeof(char*)))) + if (!((*lcom)->argv = (char**)malloc((i + 1) * sizeof(char*)))) return (-1); j = 0; while (i > 0 && j < i) { - if (!((*lcom)->args[j] = + if (!((*lcom)->argv[j] = (char*)malloc((ft_strlen(words[j + 1]) + 1) * sizeof(char)))) return (-1); - ft_strlcpy((*lcom)->args[j], words[j + 1], + ft_strlcpy((*lcom)->argv[j], words[j + 1], ft_strlen(words[j + 1]) + 1); j++; } - (*lcom)->args[j] = 0; + (*lcom)->argv[j] = 0; return (0); } @@ -87,8 +87,8 @@ void { renext = tmp->next; ft_memdel((void*)&tmp->com); - if (tmp->args) - ft_delwords(tmp->args); + if (tmp->argv) + ft_delwords(tmp->argv); if (tmp->redir != 0) ft_memdel((void*)&tmp->rdrpath); ft_memdel((void*)&tmp); @@ -107,7 +107,7 @@ t_lcom return (NULL); link->redir = 0; link->com = NULL; - link->args = NULL; + link->argv = NULL; link->rdrpath = NULL; if (ft_get_redir(word, &link) != 0) return (NULL); |