mirror of
https://github.com/DavidGailleton/42-Push_Swap.git
synced 2026-01-27 08:41:58 +00:00
Fix indexer position in main, check if stacks is well mallocked before index stack
This commit is contained in:
2
main.c
2
main.c
@@ -24,9 +24,9 @@ static int push_swap(char **tab, int len, int mod)
|
|||||||
if (mod == -1)
|
if (mod == -1)
|
||||||
return (0);
|
return (0);
|
||||||
stacks = init_stacks(len, tab, mod);
|
stacks = init_stacks(len, tab, mod);
|
||||||
indexer(stacks);
|
|
||||||
if (!stacks)
|
if (!stacks)
|
||||||
return (0);
|
return (0);
|
||||||
|
indexer(stacks);
|
||||||
if (check_order(stacks->a))
|
if (check_order(stacks->a))
|
||||||
{
|
{
|
||||||
free_all(stacks);
|
free_all(stacks);
|
||||||
|
|||||||
Reference in New Issue
Block a user