aboutsummaryrefslogtreecommitdiffstats
path: root/openbsd-compat
diff options
context:
space:
mode:
authorGilles Chehade <gilles@poolp.org>2019-09-19 01:02:51 +0200
committerGitHub <noreply@github.com>2019-09-19 01:02:51 +0200
commit094990c5ea7bca7bc1b0920b99c16b040a8229af (patch)
tree88fd45cc5bc0c92e3f3ab0a8b9aa99350d231902 /openbsd-compat
parentMerge branch 'master' into portable (diff)
downloadOpenSMTPD-094990c5ea7bca7bc1b0920b99c16b040a8229af.tar.xz
OpenSMTPD-094990c5ea7bca7bc1b0920b99c16b040a8229af.zip
Update bsd-err.c
fix output
Diffstat (limited to 'openbsd-compat')
-rw-r--r--openbsd-compat/bsd-err.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/openbsd-compat/bsd-err.c b/openbsd-compat/bsd-err.c
index a73267f9..b8dc4162 100644
--- a/openbsd-compat/bsd-err.c
+++ b/openbsd-compat/bsd-err.c
@@ -43,10 +43,11 @@ err(int r, const char *fmt, ...)
va_start(args, fmt);
fprintf(stderr, "%s: ", __progname);
- fprintf(stderr, "%s", strerror(errno));
- if (fmt != NULL)
- vfprintf(stderr, fmt, args);
- fputc('\n', stderr);
+ if (fmt != NULL) {
+ vfprintf(stderr, fmt, args);
+ fprintf(stderr, ": ");
+ }
+ fprintf(stderr, "%s\n", strerror(errno));
va_end(args);
exit(r);
}
@@ -60,9 +61,9 @@ errx(int r, const char *fmt, ...)
va_start(args, fmt);
fprintf(stderr, "%s: ", __progname);
- if (fmt != NULL)
- vfprintf(stderr, fmt, args);
- fputc('\n', stderr);
+ if (fmt != NULL)
+ vfprintf(stderr, fmt, args);
+ fprintf(stderr, "\n");
va_end(args);
exit(r);
}
@@ -76,12 +77,11 @@ warn(const char *fmt, ...)
va_start(args, fmt);
fprintf(stderr, "%s: ", __progname);
- if (fmt != NULL) {
- vfprintf(stderr, fmt, args);
- fprintf(stderr, ": ");
- }
- fprintf(stderr, "%s", strerror(errno));
- fputc('\n', stderr);
+ if (fmt != NULL) {
+ vfprintf(stderr, fmt, args);
+ fprintf(stderr, ": ");
+ }
+ fprintf(stderr, "%s\n", strerror(errno));
va_end(args);
}
#endif
@@ -94,9 +94,9 @@ warnx(const char *fmt, ...)
va_start(args, fmt);
fprintf(stderr, "%s: ", __progname);
- if (fmt != NULL)
- vfprintf(stderr, fmt, args);
- fputc('\n', stderr);
+ if (fmt != NULL)
+ vfprintf(stderr, fmt, args);
+ fprintf(stderr, "\n");
va_end(args);
}
#endif