summaryrefslogtreecommitdiff
path: root/usr.bin/pr
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2013-08-22 04:43:42 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2013-08-22 04:43:42 +0000
commit323d1abbc45a9dfeae3d39b5f8cc041dc4b73bd1 (patch)
tree64ea330e44da28fb9da88722be4cb4e200afe707 /usr.bin/pr
parent31003a7e68970e14de72e158246cccd33cccc1e7 (diff)
Correct format string mismatches turned up by -Wformat=2
suggestions and ok millert@
Diffstat (limited to 'usr.bin/pr')
-rw-r--r--usr.bin/pr/pr.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/pr/pr.c b/usr.bin/pr/pr.c
index 49cc573d3a1..5ebfcd34ecc 100644
--- a/usr.bin/pr/pr.c
+++ b/usr.bin/pr/pr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pr.c,v 1.31 2013/04/18 02:28:48 deraadt Exp $ */
+/* $OpenBSD: pr.c,v 1.32 2013/08/22 04:43:40 guenther Exp $ */
/*-
* Copyright (c) 1991 Keith Muller.
@@ -844,6 +844,7 @@ flsh_errs(void)
}
}
+static void ferrout(char *fmt, ...) __attribute__((format (printf, 1, 2)));
static void
ferrout(char *fmt, ...)
{
@@ -861,8 +862,10 @@ ferrout(char *fmt, ...)
sigprocmask(SIG_BLOCK, &block, &oblock);
if (vasprintf(&p, fmt, ap) == -1 || (f = malloc(sizeof(*f))) == NULL) {
+ va_end(ap);
+ va_start(ap, fmt);
flsh_errs();
- fprintf(stderr, fmt, ap);
+ vfprintf(stderr, fmt, ap);
fputs("pr: memory allocation failed\n", stderr);
exit(1);
}