summaryrefslogtreecommitdiff
path: root/tests/tap/messages.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tap/messages.c')
-rw-r--r--tests/tap/messages.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/tap/messages.c b/tests/tap/messages.c
index 3754d18..9c28789 100644
--- a/tests/tap/messages.c
+++ b/tests/tap/messages.c
@@ -8,8 +8,8 @@
* The canonical version of this file is maintained in the rra-c-util package,
* which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
*
- * Copyright 2002, 2004, 2005 Russ Allbery <eagle@eyrie.org>
- * Copyright 2006, 2007, 2009, 2012
+ * Copyright 2002, 2004, 2005, 2015 Russ Allbery <eagle@eyrie.org>
+ * Copyright 2006, 2007, 2009, 2012, 2014
* The Board of Trustees of the Leland Stanford Junior University
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -47,7 +47,7 @@ char *errors = NULL;
* An error handler that appends all errors to the errors global. Used by
* error_capture.
*/
-static void
+static void __attribute__((__format__(printf, 2, 0)))
message_log_buffer(int len UNUSED, const char *fmt, va_list args,
int error UNUSED)
{
@@ -75,10 +75,8 @@ message_log_buffer(int len UNUSED, const char *fmt, va_list args,
void
errors_capture(void)
{
- if (errors != NULL) {
- free(errors);
- errors = NULL;
- }
+ free(errors);
+ errors = NULL;
message_handlers_warn(1, message_log_buffer);
message_handlers_notice(1, message_log_buffer);
}