-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherror_exit.c
35 lines (31 loc) · 1.21 KB
/
error_exit.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* error_exit.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ojustine <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/10/18 10:56:18 by ojustine #+# #+# */
/* Updated: 2019/10/18 10:56:18 by ojustine ### ########.fr */
/* */
/* ************************************************************************** */
#include "fillit.h"
/*
** Terminates the program. Displays an error message.
*/
void error_exit(int err_code)
{
char mode;
mode = MODE + 48;
if (err_code == 0)
{
write(1, "usage: ./fillit ", 16);
write(1, &mode, 1);
write(1, "-mino_source_file\n", 18);
}
else if (err_code == 1)
{
write(1, "error\n", 6);
}
exit(err_code);
}