pinosaur
/
surf.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Add a file for shared functions
[surf.git]
/
common.c
diff --git a/common.c
b/common.c
new file mode 100644
(file)
index 0000000..
42662ed
--- /dev/null
+++ b/
common.c
@@ -0,0
+1,15
@@
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+void
+die(const char *errstr, ...)
+{
+ va_list ap;
+
+ va_start(ap, errstr);
+ vfprintf(stderr, errstr, ap);
+ va_end(ap);
+ exit(1);
+}
+