/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_lstadd_back.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/02/13 12:07:29 by rparodi #+# #+# */ /* Updated: 2024/03/06 12:15:50 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ #include "../includes/push_swap.h" void ft_lstadd_back(t_list **stack, t_list *new) { t_list *node; if (*stack) { node = ft_lstlast(*stack); node->next = new; new->next = NULL; } else { *stack = new; (*stack)->next = NULL; } }