From de4ae580197f9d644d1d7d26aaf8d1d67caeeba4 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Thu, 2 Jun 2016 15:56:22 +0100 Subject: [PATCH] px4_log: get the printf of fmt/args right --- src/platforms/px4_log.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/platforms/px4_log.h b/src/platforms/px4_log.h index 565458b1e5..f9e47196e2 100644 --- a/src/platforms/px4_log.h +++ b/src/platforms/px4_log.h @@ -123,6 +123,8 @@ static inline void do_nothing(int level, ...) #include #include #include +#include + #include __BEGIN_DECLS @@ -235,7 +237,10 @@ static inline void __px4_log_modulename(int level, const char *fmt, ...) if (level <= __px4_log_level_current) { printf(__px4__log_level_fmt __px4__log_level_arg(level)); printf(__px4__log_modulename_fmt __px4__log_modulename_arg); - printf(fmt); + va_list argptr; + va_start(argptr, fmt); + vprintf(fmt, argptr); + va_end(argptr); printf("\n"); } }