diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-04-20 22:24:25 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-04-20 22:24:25 +0200 |
commit | fe24a254415b38952eeef8f0ca4e830549360850 (patch) | |
tree | f51808f7ed9ccc7840878de4d1c9d5408c6eaa45 /src/ft_p_lcom.c | |
parent | Wrong address (diff) | |
download | 42-minishell-fe24a254415b38952eeef8f0ca4e830549360850.tar.gz 42-minishell-fe24a254415b38952eeef8f0ca4e830549360850.tar.bz2 42-minishell-fe24a254415b38952eeef8f0ca4e830549360850.tar.xz 42-minishell-fe24a254415b38952eeef8f0ca4e830549360850.tar.zst 42-minishell-fe24a254415b38952eeef8f0ca4e830549360850.zip |
Pretty good start
Diffstat (limited to 'src/ft_p_lcom.c')
-rw-r--r-- | src/ft_p_lcom.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/ft_p_lcom.c b/src/ft_p_lcom.c index f965555..6711b85 100644 --- a/src/ft_p_lcom.c +++ b/src/ft_p_lcom.c @@ -17,21 +17,25 @@ int8_t ft_p_lcom(const char line[], - const int64_t count, + const uint64_t count, t_msh *msh) { - int64_t i; + uint64_t i; char **words; i = 0; if (!(words = ft_split(line, ';'))) return (-1); - while (i < count) + while (i <= count) { if (!(msh->lcom = ft_lcom_new(words[i]))) { return (-1); } + if (i < 1) + { + msh->lcom_head = msh->lcom; + } msh->lcom = msh->lcom->next; i++; } |