From 5a11c5f4cb472d1699f77b3c039af848d1e792e9 Mon Sep 17 00:00:00 2001 From: Tanguy MAZE Date: Tue, 26 Mar 2019 15:37:11 +0100 Subject: [PATCH] corrected rerot --- srcs/ps_rerot.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/srcs/ps_rerot.c b/srcs/ps_rerot.c index 77bdb15..3d99203 100644 --- a/srcs/ps_rerot.c +++ b/srcs/ps_rerot.c @@ -6,7 +6,7 @@ /* By: tmaze +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/02/21 16:32:04 by tmaze #+# #+# */ -/* Updated: 2019/03/20 21:33:00 by tmaze ### ########.fr */ +/* Updated: 2019/03/26 15:06:28 by tmaze ### ########.fr */ /* */ /* ************************************************************************** */ @@ -29,11 +29,8 @@ void ps_rerot(t_psdata *data, char c) if (s != NULL && *size > 2) { tmp = s->next; - while (tmp->next != NULL) - { - tmp = tmp->next; + while (tmp->next != NULL && (tmp = tmp->next)) s = s->next; - } s->next = NULL; (*size)--; ps_stkpsh(data, c, tmp);