-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherror_messages_b.c
68 lines (60 loc) · 1.61 KB
/
error_messages_b.c
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* error_messages_b.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mmeier <mmeier@student.hive.fi> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/13 15:53:19 by mmeier #+# #+# */
/* Updated: 2024/04/18 10:59:47 by mmeier ### ########.fr */
/* */
/* ************************************************************************** */
#include "so_long.h"
int wrong_format_error(void)
{
ft_printf("Error\nMap is in wrong format :(\n");
return (-1);
}
int error_open_file(void)
{
ft_printf("Error\nFile could not be opened :(\n");
return (-1);
}
int free_arr(char **av)
{
int j;
j = 0;
if (av[j] == NULL || av == NULL)
return (-1);
while (av[j])
{
free(av[j]);
av[j] = NULL;
j++;
}
free(av);
av = NULL;
return (1);
}
int free_arr_size(char **av)
{
int j;
j = 0;
if (av[j] == NULL || av == NULL)
return (-1);
while (av[j])
{
free(av[j]);
av[j] = NULL;
j++;
}
free(av);
av = NULL;
ft_printf("Error\nMap is too big :(\n");
return (0);
}
int wrong_ac_count(void)
{
ft_printf("Error\nInvalid amount of arguments given to program :(\n");
return (-1);
}