From ce1f9df3a9f861d136d6f0c93a6f811c364d1d3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Janel?= <67502353+sjanel@users.noreply.github.com> Date: Sat, 12 Aug 2023 14:17:22 +0200 Subject: [PATCH] Fix warning vla-extension by changing MB_CUR_MAX into MB_LEN_MAX which is a compile time constant (#302) --- include/jwt-cpp/jwt.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/jwt-cpp/jwt.h b/include/jwt-cpp/jwt.h index 3074bee30..b2b998a2e 100644 --- a/include/jwt-cpp/jwt.h +++ b/include/jwt-cpp/jwt.h @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -3042,7 +3043,7 @@ namespace jwt { std::string out; out.reserve(wide.size()); for (wchar_t wc : wide) { - char mb[MB_CUR_MAX]; + char mb[MB_LEN_MAX]; std::size_t n = std::wcrtomb(mb, wc, &state); if (n != static_cast(-1)) out.append(mb, n); }