-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpush_swap.c
More file actions
37 lines (34 loc) · 1.22 KB
/
Copy pathpush_swap.c
File metadata and controls
37 lines (34 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* push_swap.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: moerradi <moerradi@student.1337.ma> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/05/30 16:01:53 by moerradi #+# #+# */
/* Updated: 2021/06/22 06:55:02 by moerradi ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
int main(int argc, char **argv)
{
t_env e;
ft_bzero(&e, sizeof(t_env));
e.len = argc - 1;
e.arr = malloc(sizeof(int) * e.len);
if (argc < 2)
{
free(e.arr);
return (0);
}
if (!init(&e, argv))
exiterr(&e);
go(&e);
if (e.a)
free_stack(&e.a);
if (e.b)
free_stack(&e.b);
if (e.arr)
free(e.arr);
return (0);
}