diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-08-20 23:21:43 +0200 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-08-20 23:21:43 +0200 |
| commit | d3cf16e078e92ab85e5ad2f30f2c07ce382fd98e (patch) | |
| tree | 371f93b833356e665d29cc6ca52f58e6162c14c5 /src/lst/ft_lstdestroy.c | |
| parent | ffaebd5ffe714799254d6c520c4ad19a0157e672 (diff) | |
| download | libft-d3cf16e078e92ab85e5ad2f30f2c07ce382fd98e.tar.gz libft-d3cf16e078e92ab85e5ad2f30f2c07ce382fd98e.tar.bz2 libft-d3cf16e078e92ab85e5ad2f30f2c07ce382fd98e.zip | |
Added ft_lstpush_front_node, ft_lstdestroy returns NULL
Diffstat (limited to 'src/lst/ft_lstdestroy.c')
| -rw-r--r-- | src/lst/ft_lstdestroy.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lst/ft_lstdestroy.c b/src/lst/ft_lstdestroy.c index 35da2a5..2af6fb7 100644 --- a/src/lst/ft_lstdestroy.c +++ b/src/lst/ft_lstdestroy.c @@ -6,7 +6,7 @@ /* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/10/09 09:02:39 by cacharle #+# #+# */ -/* Updated: 2019/11/20 04:02:37 by cacharle ### ########.fr */ +/* Updated: 2020/08/20 14:36:17 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -15,15 +15,17 @@ /* ** \brief Destroy a list and set his pointer to NULL ** \param del Delete Function for data of each node +** \return returns NULL */ -void ft_lstdestroy(t_ftlst **lst, void (*del)(void *)) +void *ft_lstdestroy(t_ftlst **lst, void (*del)(void *)) { if (lst == NULL) - return ; + return (NULL); if (*lst == NULL) - return ; + return (NULL); ft_lstdestroy(&((*lst)->next), del); ft_lstdelone(*lst, del); *lst = NULL; + return (NULL); } |
