aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/eprintf.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/util/eprintf.c b/util/eprintf.c
index 6d6fa65..af05686 100644
--- a/util/eprintf.c
+++ b/util/eprintf.c
@@ -6,8 +6,6 @@
#include "../util.h"
-char *argv0;
-
static void venprintf(int, const char *, va_list);
void
@@ -33,8 +31,6 @@ enprintf(int status, const char *fmt, ...)
void
venprintf(int status, const char *fmt, va_list ap)
{
- fprintf(stderr, "%s: ", argv0);
-
vfprintf(stderr, fmt, ap);
if(fmt[0] && fmt[strlen(fmt)-1] == ':') {
@@ -44,3 +40,17 @@ venprintf(int status, const char *fmt, va_list ap)
exit(status);
}
+
+void
+weprintf(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+ if (fmt[0] && fmt[strlen(fmt)-1] == ':') {
+ fputc(' ', stderr);
+ perror(NULL);
+ }
+}