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); }