diff --git a/include/sys/cbprintf.h b/include/sys/cbprintf.h index 51700bca37a..0c56267bcd9 100644 --- a/include/sys/cbprintf.h +++ b/include/sys/cbprintf.h @@ -11,7 +11,6 @@ #include #include #include -#include #ifdef CONFIG_CBPRINTF_LIBC_SUBSTS #include @@ -36,6 +35,9 @@ extern "C" { #endif #endif +/* Z_C_GENERIC is used there */ +#include + /** * @defgroup cbprintf_apis Formatted Output APIs * @ingroup support_apis diff --git a/include/sys/cbprintf_internal.h b/include/sys/cbprintf_internal.h index 75cb8d9f3a7..c5de3137de7 100644 --- a/include/sys/cbprintf_internal.h +++ b/include/sys/cbprintf_internal.h @@ -242,7 +242,7 @@ do { \ "Buffer must be aligned."); \ } \ uint8_t *_pbuf = buf; \ - size_t _pmax = (buf != NULL) ? *_inlen : SIZE_MAX; \ + size_t _pmax = (buf != NULL) ? _inlen : SIZE_MAX; \ size_t _pkg_len = 0; \ union z_cbprintf_hdr *_len_loc; \ /* package starts with string address and field with length */ \