-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_lstdel.c
25 lines (23 loc) · 1.15 KB
/
ft_lstdel.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
/* ************************************************************************** */
/* LE - / */
/* / */
/* ft_lstdel.c .:: .:/ . .:: */
/* +:+:+ +: +: +:+:+ */
/* By: davfelix <[email protected]> +:+ +: +: +:+ */
/* #+# #+ #+ #+# */
/* Created: 2018/11/02 14:54:17 by davfelix #+# ## ## #+# */
/* Updated: 2018/11/02 18:41:53 by davfelix ### #+. /#+ ###.fr */
/* / */
/* / */
/* ************************************************************************** */
#include "libft.h"
void ft_lstdel(t_list **alst, void (*del)(void *, size_t))
{
while (*alst)
{
del((*alst)->content, (*alst)->content_size);
free(*alst);
*alst = (*alst)->next;
}
*alst = NULL;
}