ft_nm/subprojects/libft/ft_lst_rev.c

32 lines
1.1 KiB
C
Raw Permalink Normal View History

2019-05-10 18:29:21 +03:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lst_rev.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gtertysh <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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;
}