-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror_mess.c
More file actions
36 lines (33 loc) · 1.25 KB
/
error_mess.c
File metadata and controls
36 lines (33 loc) · 1.25 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* error_mess.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bhielsch <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/15 12:36:43 by bhielsch #+# #+# */
/* Updated: 2022/12/15 12:36:44 by bhielsch ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
void error_mess(char *str, t_stack *stack)
{
int i;
i = 0;
ft_printf("%s", str);
if (stack->argc == 2 && stack->aon > 1 && stack->bol != -1)
{
while (i < stack->aon)
free(stack->word[i++]);
free(stack->word);
}
else if (stack->bol == -1)
{
free(stack->stcka);
free(stack->stckb);
exit(0);
}
free(stack->stcka);
free(stack->stckb);
exit(0);
}