Browse Source

correct

master
Elouan MARTINET 4 years ago
parent
commit
310c454383
  1. 6
      ex08/ft_list_reverse.c

6
ex08/ft_list_reverse.c

@ -6,7 +6,7 @@
/* By: emartine <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/08/16 13:57:05 by emartine #+# #+# */
/* Updated: 2017/08/19 15:51:45 by emartine ### ########.fr */
/* Updated: 2017/08/21 14:36:45 by emartine ### ########.fr */
/* */
/* ************************************************************************** */
@ -24,11 +24,11 @@ void ft_list_reverse(t_list **begin_list)
while (last->next)
last = last->next;
current = last;
while (*begin_list && (*begin_list)->next)
while ((*begin_list)->next)
{
previous = *begin_list;
while (previous->next != current)
previous = current->next;
previous = previous->next;
previous->next = 0;
current->next = previous;
current = previous;

Loading…
Cancel
Save