42/d11/ex06/ft_list_clear.c

27 lines
1.1 KiB
C
Raw Normal View History

2016-11-20 02:20:23 +02:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_list_clear.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gtertysh <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/09 15:09:41 by gtertysh #+# #+# */
/* Updated: 2016/11/09 15:21:58 by gtertysh ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdlib.h>
#include "ft_list.h"
void ft_list_clear(t_list **begin_list)
{
t_list *temp;
while (*begin_list)
{
temp = (*begin_list)->next;
free(*begin_list);
*begin_list = temp;
}
}