Archived
1
0
This repository has been archived on 2024-10-25. You can view files and clone it, but cannot push or open issues or pull requests.
pipex/libft/lst/ft_lstclear.c
2024-04-11 14:02:42 +02:00

27 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstclear.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/11 18:05:14 by adjoly #+# #+# */
/* Updated: 2024/02/04 13:55:17 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include "../libft.h"
void ft_lstclear(t_list **lst, void (*del)(void *))
{
t_list *tmp;
tmp = NULL;
while (lst && *lst && del)
{
tmp = (*lst)->next;
ft_lstdelone((*lst), del);
*lst = tmp;
}
}