[PATCH rendercheck 1/2] Fix errx handling of va_list
Peter Hutterer
peter.hutterer at who-t.net
Mon Mar 27 23:08:54 UTC 2017
And set the function attribute to printf-style
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
rendercheck.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/rendercheck.h b/rendercheck.h
index 7dc9dc9..89db20d 100644
--- a/rendercheck.h
+++ b/rendercheck.h
@@ -31,12 +31,14 @@
#else
# include <stdarg.h>
# include <stdlib.h>
-static inline void errx(int eval, const char *fmt, ...) {
+__attribute__((format(printf, 2, 3)))
+static inline void errx(int eval, const char *fmt, ...)
+{
va_list args;
va_start(args, fmt);
fprintf(stderr, "Fatal Error: ");
- fprintf(stderr, fmt, args);
+ vfprintf(stderr, fmt, args);
fprintf(stderr, "\n");
va_end(args);
exit(eval);
--
2.9.3
More information about the xorg-devel
mailing list