-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathError.cpp
More file actions
40 lines (33 loc) · 1.02 KB
/
Error.cpp
File metadata and controls
40 lines (33 loc) · 1.02 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
40
/* -------------------------------------------------
_ _ ___
__ _| |_ _ _(_)___/ __| __ __ _ _ _ _ _ ___ _ _
/ _` | _| '_| / -_)__ \/ _/ _` | ' \| ' \/ -_) '_|
\__, |\__|_| |_\___|___/\__\__,_|_||_|_||_\___|_|
|___/
gtrieScanner: quick discovery of network motifs
Released under Artistic License 2.0
(see README and LICENSE)
Pedro Ribeiro - CRACS & INESC-TEC, DCC/FCUP
----------------------------------------------------
Error Utilities
Last Update: 11/02/2012
---------------------------------------------------- */
#include "Error.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
void Error::msg(const char *format, ...) {
va_list p;
if (format == NULL)
msg("%s", (char *)strerror (errno));
else {
fprintf (stderr, ERROR_HEADER);
va_start (p, format);
vfprintf (stderr, format, p);
va_end (p);
fprintf (stderr, "\n");
}
exit(EXIT_FAILURE);
}