aboutsummaryrefslogtreecommitdiff
path: root/src/err.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/err.c')
-rw-r--r--src/err.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/err.c b/src/err.c
new file mode 100644
index 0000000..35b81f0
--- /dev/null
+++ b/src/err.c
@@ -0,0 +1,18 @@
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "dbx.h"
+
+void dbx_printerr(const char *format, ...) {
+ va_list ap;
+ va_start(ap, format);
+ fprintf(stderr, "%s: ", progname);
+ vfprintf(stderr, format, ap);
+ fprintf(stderr, "\n");
+ va_end(ap);
+}
+
+void dbx_perror(const char *s, int e) {
+ fprintf(stderr, "%s: %s\n", s, strerror(e));
+}