/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_lst_rev.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: gtertysh +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/09 16:28:30 by gtertysh #+# #+# */ /* Updated: 2016/11/09 17:06:02 by gtertysh ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" void ft_lst_rev(t_list **begin_list) { t_list *prev; t_list *next; t_list *curr; prev = NULL; curr = *begin_list; while (curr) { next = curr->next; curr->next = prev; prev = curr; curr = next; } *begin_list = prev; }