-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_lstclear.c
28 lines (25 loc) · 1.1 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
27
28
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstclear.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: djmekki < [email protected] +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/04/20 06:13:57 by djmekki #+# #+# */
/* Updated: 2022/04/24 03:10:46 by djmekki ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstclear(t_list **lst, void (*del)(void *))
{
t_list *current;
t_list *next;
current = *lst;
while (current)
{
next = current->next;
ft_lstdelone(current, del);
current = next;
}
*lst = NULL;
}