aboutsummaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/util.c b/src/util.c
index cf92dc2..29a5399 100644
--- a/src/util.c
+++ b/src/util.c
@@ -17,7 +17,19 @@
*/
#include "globals.h"
-#include <sys/resource.h>
+
+void __attribute__((noreturn)) error(const char *fmt, ...)
+{
+ char buf[128];
+ memset(buf, 0, sizeof(buf));
+ va_list ap;
+ va_start(ap, fmt);
+ vsnprintf(buf, sizeof(buf), fmt, ap);
+ va_end(ap);
+ perror(buf);
+ abort();
+ exit(EXIT_FAILURE);
+}
void remove_cruft(char *str)
{