/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_lstadd_back.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: mdenys +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/11/04 18:15:55 by mdenys #+# #+# */ /* Updated: 2020/11/04 18:36:49 by mdenys ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" void ft_lstadd_back(t_list **lst, t_list *new) { t_list *temp; temp = *lst; if (*lst) { while (temp->next != NULL) temp = temp->next; temp->next = new; } else if (*lst == NULL) { *lst = new; } }