aboutsummaryrefslogtreecommitdiff
path: root/die.c
diff options
context:
space:
mode:
Diffstat (limited to 'die.c')
-rw-r--r--die.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/die.c b/die.c
new file mode 100644
index 0000000..0635b31
--- /dev/null
+++ b/die.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+
+#include "die.h"
+
+void die(const char* fmt, ...) {
+ va_list args;
+ va_start(args, fmt);
+ vfprintf(stderr, fmt, args);
+ fflush(stderr);
+ va_end(args);
+
+ exit(EXIT_FAILURE);
+}
+