-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_error.c
29 lines (27 loc) · 1.12 KB
/
ft_error.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_error.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: malexand <malexand@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/30 17:01:17 by malexand #+# #+# */
/* Updated: 2017/02/24 16:24:22 by malexand ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void error(int error, int send_perror, char *str)
{
if (send_perror == 1)
{
ft_putstr_color("Error \x1B[0m: ", RED);
perror("");
}
else
{
ft_putstr_color("Error", RED);
ft_putstr(" : ");
ft_putendl(str);
}
exit(error);
}