From 506378cf2134c5c4b36f0441100ab806307fd832 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Wed, 18 Sep 2019 23:47:24 +0200 Subject: nxcompshad: fix logging segfault One cannot simply pass down a va_list to another function that expects variable arguments ("..."). The prototype of the called functions must expect a va_list argument instead. This fixes segfaults that happen e.g. after compiling X11.cpp with TEST and effectively reverts 59e829f3647005a6c93662adfbcea36e27a993d8. --- nxcompshad/src/Logger.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'nxcompshad/src/Logger.h') diff --git a/nxcompshad/src/Logger.h b/nxcompshad/src/Logger.h index 8436c5f15..c4c46fe9a 100644 --- a/nxcompshad/src/Logger.h +++ b/nxcompshad/src/Logger.h @@ -43,17 +43,17 @@ class Logger { public: - void user(const char *format, ...) __attribute__((format(printf, 2, 0))); + void user(const char *format, va_list arguments) __attribute__((format(printf, 2, 0))); void error(const char *name, int error); - void warning(const char *name, const char *format, ...) __attribute__((format(printf, 3, 0))); + void warning(const char *name, const char *format, va_list arguments) __attribute__((format(printf, 3, 0))); - void test(const char *name, const char *format, ...) __attribute__((format(printf, 3, 0))); + void test(const char *name, const char *format, va_list arguments) __attribute__((format(printf, 3, 0))); void trace(const char *name); - void debug(const char *name, const char *format, ...) __attribute__((format(printf, 3, 0))); + void debug(const char *name, const char *format, va_list arguments) __attribute__((format(printf, 3, 0))); void dump(const char *name, const char *data, int size); }; -- cgit v1.2.3