26 lines
1.1 KiB
C
26 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* 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;
|
|
}
|
|
}
|