-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.c
More file actions
34 lines (32 loc) · 1.2 KB
/
errors.c
File metadata and controls
34 lines (32 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
/* ************************************************************************** */
/* */
/* :::::::: */
/* errors.c :+: :+: */
/* +:+ */
/* By: fhignett <fhignett@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2019/03/22 16:27:21 by fhignett #+# #+# */
/* Updated: 2019/03/22 16:46:41 by fhignett ######## odam.nl */
/* */
/* ************************************************************************** */
#include "fdf.h"
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
int errors(int error, char *str)
{
if (error == 1)
{
error = open(str, O_RDONLY);
close(error);
if (error < 0)
return (0);
}
else if (error == 2)
{
(void)str;
ft_putendl("Found wrong line length. Exiting.");
exit(0);
}
return (1);
}