Skip to content

Commit ce1f9df

Browse files
authored
Fix warning vla-extension by changing MB_CUR_MAX into MB_LEN_MAX which is a compile time constant (#302)
1 parent 6fed66d commit ce1f9df

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/jwt-cpp/jwt.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#include <algorithm>
2525
#include <chrono>
26+
#include <climits>
2627
#include <cmath>
2728
#include <cstring>
2829
#include <functional>
@@ -3042,7 +3043,7 @@ namespace jwt {
30423043
std::string out;
30433044
out.reserve(wide.size());
30443045
for (wchar_t wc : wide) {
3045-
char mb[MB_CUR_MAX];
3046+
char mb[MB_LEN_MAX];
30463047
std::size_t n = std::wcrtomb(mb, wc, &state);
30473048
if (n != static_cast<std::size_t>(-1)) out.append(mb, n);
30483049
}

0 commit comments

Comments
 (0)