From 43e6c82cad5d790c75c918a4eca85cdec894d1c8 Mon Sep 17 00:00:00 2001 From: Charles Date: Fri, 18 Oct 2019 15:31:00 +0200 Subject: Fixed ft_substr, added a few protection to list functions --- ft_lstclear_bonus.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ft_lstclear_bonus.c') diff --git a/ft_lstclear_bonus.c b/ft_lstclear_bonus.c index ca80fb2..e8f0541 100644 --- a/ft_lstclear_bonus.c +++ b/ft_lstclear_bonus.c @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/10/09 09:02:39 by cacharle #+# #+# */ -/* Updated: 2019/10/17 09:03:58 by cacharle ### ########.fr */ +/* Updated: 2019/10/17 11:03:13 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -15,7 +15,9 @@ void ft_lstclear(t_list **lst, void (*del)(void *)) { - if (*lst == NULL || lst == NULL || del == NULL) + if (lst == NULL || del == NULL) + return ; + if (*lst == NULL) return ; ft_lstclear(&((*lst)->next), del); ft_lstdelone(*lst, del); -- cgit