diff --git a/src/parser/wordlist/wordlist_copy.c b/src/parser/wordlist/wordlist_copy.c index 056afa4..e3794a6 100644 --- a/src/parser/wordlist/wordlist_copy.c +++ b/src/parser/wordlist/wordlist_copy.c @@ -6,7 +6,7 @@ /* By: khais +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/03/04 12:07:53 by khais #+# #+# */ -/* Updated: 2025/03/09 14:29:36 by khais ### ########.fr */ +/* Updated: 2025/03/10 15:05:51 by khais ### ########.fr */ /* */ /* ************************************************************************** */ @@ -32,9 +32,11 @@ t_wordlist *wordlist_copy(const t_wordlist *wordlist) while (wordlist != NULL) { if (wordlist->next != NULL) + { current->next = ft_calloc(1, sizeof(t_wordlist)); - if (current->next == NULL) - return (wordlist_destroy(outlist), NULL); + if (current->next == NULL) + return (wordlist_destroy(outlist), NULL); + } wordlist = wordlist->next; current = current->next; if (wordlist == NULL)