42_libft/ft_lstdelone.c

26 lines
1.1 KiB
C
Raw Permalink Normal View History

2022-09-27 11:25:41 -04:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
2022-10-04 08:21:55 -04:00
/* ft_lstdelone.c :+: :+: :+: */
2022-09-27 11:25:41 -04:00
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
2022-10-04 08:21:55 -04:00
/* Created: 2022/09/30 00:02:55 by cchauvet #+# #+# */
2022-10-05 15:04:45 -04:00
/* Updated: 2022/10/05 21:01:41 by cchauvet ### ########.fr */
2022-09-27 11:25:41 -04:00
/* */
/* ************************************************************************** */
#include "libft.h"
2022-10-04 08:21:55 -04:00
void ft_lstdelone(t_list *lst, void (*del)(void *))
2022-09-27 11:25:41 -04:00
{
2022-10-05 15:04:45 -04:00
if (del == NULL || lst == NULL)
2022-10-04 08:21:55 -04:00
return ;
if (lst != NULL)
{
if (lst->content != NULL)
del(lst->content);
free(lst);
}
2022-09-27 11:25:41 -04:00
}