-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lstclear.c
26 lines (23 loc) · 1.06 KB
/
ft_lstclear.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstclear.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: kyalexan <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/11/22 10:27:02 by kyalexan #+# #+# */
/* Updated: 2021/12/12 12:30:33 by kyalexan ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstclear(t_list **lst, void (*del)(void *))
{
t_list *next;
while ((*lst))
{
next = (*lst)->next;
del((*lst)->content);
free(*lst);
(*lst) = next;
}
}