-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.c
More file actions
39 lines (34 loc) · 1.2 KB
/
error.c
File metadata and controls
39 lines (34 loc) · 1.2 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
38
39
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* error.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: musyilma <musyilma@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/09 11:03:42 by musyilma #+# #+# */
/* Updated: 2025/02/11 13:46:46 by musyilma ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdlib.h>
#include <unistd.h>
void ft_error(char **av, int sp)
{
int j;
j = 0;
while (av[++j] && sp == 1)
free(av[j]);
if (sp == 1)
free(av);
write(2, "Error\n", 6);
exit(1);
}
void ft_error2(char **av, int sp)
{
int j;
j = 0;
while (av[++j] && sp == 1)
free(av[j]);
if (sp == 1)
free(av);
exit(0);
}