]> Pileus Git - wmpus/blobdiff - util.c
X11 updates
[wmpus] / util.c
diff --git a/util.c b/util.c
index 2099953ddce60d2832e9fe7f6c814e82e4ebfed9..c5f3b9af021c3351488198be26a5ccbbee8bde20 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1,5 +1,6 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include <stdarg.h>
 
 #include "util.h"
 
@@ -47,3 +48,16 @@ int list_length(list_t *node)
 void list_move(list_t *node, int offset)
 {
 }
+
+/* Misc */
+int error(char *fmt, ...)
+{
+       va_list ap;
+       va_start(ap, fmt);
+       fprintf(stderr, "Error: ");
+       vfprintf(stderr, fmt, ap);
+       fprintf(stderr, "\n");
+       va_end(ap);
+       exit(1);
+       return 0;
+}