diff --git a/.push_swap.c.swm b/.push_swap.c.swm deleted file mode 100644 index fcb7255..0000000 Binary files a/.push_swap.c.swm and /dev/null differ diff --git a/.push_swap.c.swn b/.push_swap.c.swn deleted file mode 100644 index 37ca323..0000000 Binary files a/.push_swap.c.swn and /dev/null differ diff --git a/.push_swap.c.swo b/.push_swap.c.swo deleted file mode 100644 index d3916d9..0000000 Binary files a/.push_swap.c.swo and /dev/null differ diff --git a/.push_swap.c.swp b/.push_swap.c.swp deleted file mode 100644 index c8c8614..0000000 Binary files a/.push_swap.c.swp and /dev/null differ diff --git a/push_swap.c b/push_swap.c index 3303e4c..22a1c21 100644 --- a/push_swap.c +++ b/push_swap.c @@ -6,7 +6,7 @@ /* By: erey-bet +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/11/23 16:48:12 by erey-bet #+# #+# */ -/* Updated: 2022/12/11 15:51:26 by erey-bet ### ########.fr */ +/* Updated: 2022/12/11 17:46:16 by erey-bet ### ########.fr */ /* */ /* ************************************************************************** */ @@ -83,10 +83,8 @@ void push_swap_5(long *tab, int len) t_stack sb; sa.list = get_index(tab, len); - if (sa.list == NULL) - return ; sa.len = len; - if (init_sb(&sb, len) == NULL) + if (!init_sb(&sb, len) || !sa.list || check_sa(sa)) return ; while (sb.len != 2) {