From eb8bce4825c71cdacc9e94695d2b429ffad9c608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Fri, 3 Mar 2017 09:33:43 +0100 Subject: [PATCH] sdlog2: fix PARAM name truncation if a parameter name was 16 characters long (which is valid), the last character got truncated due to 0-terminated string. This raises the param name to 64 chars, which is quite wasteful, but there is no other length in between. --- src/modules/sdlog2/sdlog2_messages.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/sdlog2/sdlog2_messages.h b/src/modules/sdlog2/sdlog2_messages.h index e3ea3291f8..afd4fc084c 100644 --- a/src/modules/sdlog2/sdlog2_messages.h +++ b/src/modules/sdlog2/sdlog2_messages.h @@ -659,7 +659,7 @@ struct log_VER_s { /* --- PARM - PARAMETER --- */ #define LOG_PARM_MSG 131 struct log_PARM_s { - char name[16]; + char name[64]; float value; }; #pragma pack(pop) @@ -736,7 +736,7 @@ static const struct log_format_s log_formats[] = { /* FMT: don't write format of format message, it's useless */ LOG_FORMAT(TIME, "Q", "StartTime"), LOG_FORMAT(VER, "NZ", "Arch,FwGit"), - LOG_FORMAT(PARM, "Nf", "Name,Value") + LOG_FORMAT(PARM, "Zf", "Name,Value") }; static const unsigned log_formats_num = sizeof(log_formats) / sizeof(log_formats[0]);