From b097f5c5f898570b8131447c8f57e96039a7697c Mon Sep 17 00:00:00 2001 From: Krzysztof Chruscinski Date: Fri, 26 Aug 2022 15:34:00 +0200 Subject: [PATCH] logging: Use new cbprintf check for pointers Cbprintf has new feature where it can distinguish between character pointers used for %p and %s. It is enabled by flag CBPRINTF_PACKAGE_CONVERT_PTR_CHECK. Signed-off-by: Krzysztof Chruscinski --- subsys/logging/log_msg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subsys/logging/log_msg.c b/subsys/logging/log_msg.c index 962f84c8342..456cb0f94a4 100644 --- a/subsys/logging/log_msg.c +++ b/subsys/logging/log_msg.c @@ -52,7 +52,8 @@ void z_impl_z_log_msg_static_create(const void *source, struct log_msg *msg; if (inlen > 0) { - uint32_t flags = CBPRINTF_PACKAGE_CONVERT_RW_STR; + uint32_t flags = CBPRINTF_PACKAGE_CONVERT_RW_STR | + CBPRINTF_PACKAGE_CONVERT_PTR_CHECK; uint16_t strl[4]; int len;