Skip to content

Commit

Permalink
Fix warning vla-extension by changing MB_CUR_MAX into MB_LEN_MAX whic…
Browse files Browse the repository at this point in the history
…h is a compile time constant (#302)
  • Loading branch information
sjanel authored Aug 12, 2023
1 parent 6fed66d commit ce1f9df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/jwt-cpp/jwt.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include <algorithm>
#include <chrono>
#include <climits>
#include <cmath>
#include <cstring>
#include <functional>
Expand Down Expand Up @@ -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<std::size_t>(-1)) out.append(mb, n);
}
Expand Down

0 comments on commit ce1f9df

Please sign in to comment.