From 2e8eba35ff2d39fe507e6a923310a089b7e708d5 Mon Sep 17 00:00:00 2001 From: anchao Date: Sun, 26 Aug 2018 06:50:47 -0600 Subject: [PATCH] libs/libc/syslog/lib_syslog.c: Fix syslog crash on 64bit simulation. --- libs/libc/syslog/lib_syslog.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/libc/syslog/lib_syslog.c b/libs/libc/syslog/lib_syslog.c index 6f1ec22877..8bbe16f2c0 100644 --- a/libs/libc/syslog/lib_syslog.c +++ b/libs/libc/syslog/lib_syslog.c @@ -65,6 +65,8 @@ void vsyslog(int priority, FAR const IPTR char *fmt, va_list ap) { + va_list copy; + /* Check if this priority is enabled */ if ((g_syslog_mask & LOG_MASK(priority)) != 0) @@ -76,7 +78,8 @@ void vsyslog(int priority, FAR const IPTR char *fmt, va_list ap) * of structures in the NuttX sycalls does not work. */ - (void)nx_vsyslog(priority, fmt, &ap); + va_copy(copy, ap); + (void)nx_vsyslog(priority, fmt, ©); } }