/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_lstclear_bonus.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: narnaud +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2021/10/22 14:53:04 by narnaud #+# #+# */ /* Updated: 2021/11/15 13:07:08 by narnaud ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" void ft_lstclear(t_list **lst, void (*del)(void *)) { t_list *next_cell; if (!del) return ; while (lst && *lst) { next_cell = (*lst)->next; ft_lstdelone(*lst, del); *lst = next_cell; } }