Files
libft/ft_lstclear_bonus.c
Angel Ortigosa Perez c87ab67280 Libft aortigos
2025-11-15 09:18:35 +01:00

28 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstclear.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aortigos <aortigos@student.42malaga.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/23 16:28:57 by aortigos #+# #+# */
/* Updated: 2023/10/23 17:30:44 by aortigos ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstclear(t_list **lst, void (*del)(void*))
{
t_list *tmp;
if (!del || !lst || !*lst)
return ;
while (lst && *lst)
{
tmp = (*lst)->next;
ft_lstdelone(*lst, del);
*lst = tmp;
}
}