diff options
Diffstat (limited to '')
-rw-r--r-- | src/ft_p_lcom.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/ft_p_lcom.c b/src/ft_p_lcom.c index 6711b85..f928f5d 100644 --- a/src/ft_p_lcom.c +++ b/src/ft_p_lcom.c @@ -17,26 +17,23 @@ int8_t ft_p_lcom(const char line[], - const uint64_t count, - t_msh *msh) + const uint64_t count, + t_msh *msh) { uint64_t i; - char **words; + t_lcom *link; + char **words; i = 0; if (!(words = ft_split(line, ';'))) return (-1); while (i <= count) { - if (!(msh->lcom = ft_lcom_new(words[i]))) + if (!(link = ft_lcom_new(words[i]))) { return (-1); } - if (i < 1) - { - msh->lcom_head = msh->lcom; - } - msh->lcom = msh->lcom->next; + ft_lcom_add_back(&msh->curr, link); i++; } return (0); |