rendercheck: 2 commits - rendercheck.h

Eric Anholt anholt at kemper.freedesktop.org
Wed Mar 29 20:19:09 UTC 2017


 rendercheck.h |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 032b080f899a2ddc65605fb73649709de9c7ace4
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Mar 28 09:08:54 2017 +1000

    Fix errx handling of va_list
    
    And set the function attribute to printf-style
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Eric Anholt <eric at anholt.net>

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);
commit e3ce1a8af0398a3f7818b98a51fda5e89c180658
Author: Eric Anholt <eric at anholt.net>
Date:   Fri Mar 24 12:23:15 2017 -0700

    Fix a printf format warning.
    
    Found when I accidentally built with !HAVE_ERR_H
    
    Signed-off-by: Eric Anholt <eric at anholt.net>

diff --git a/rendercheck.h b/rendercheck.h
index 1c392e8..7dc9dc9 100644
--- a/rendercheck.h
+++ b/rendercheck.h
@@ -37,7 +37,7 @@ static inline void errx(int eval, const char *fmt, ...) {
     va_start(args, fmt);
     fprintf(stderr, "Fatal Error: ");
     fprintf(stderr, fmt, args);
-    fprintf(stderr, "\n", args);
+    fprintf(stderr, "\n");
     va_end(args);
     exit(eval);
 }


More information about the xorg-commit mailing list