diff --git a/include/nlohmann/detail/output/serializer.hpp b/include/nlohmann/detail/output/serializer.hpp index aafa21a12..4171abea8 100644 --- a/include/nlohmann/detail/output/serializer.hpp +++ b/include/nlohmann/detail/output/serializer.hpp @@ -578,7 +578,7 @@ class serializer case error_handler_t::keep: { // copy undumped chars to string buffer - for (int j = 0; j < undumped_chars; ++j) + for (std::size_t j = 0; j < undumped_chars; ++j) { string_buffer[bytes++] = s[bytes_after_last_accept + j]; } @@ -632,7 +632,7 @@ class serializer case error_handler_t::keep: { // copy undumped chars to string buffer - for (int j = 0; j < undumped_chars; ++j) + for (std::size_t j = 0; j < undumped_chars; ++j) { string_buffer[bytes++] = s[bytes_after_last_accept + j]; } diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index e8b80ad33..f0b118718 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -19140,7 +19140,7 @@ class serializer case error_handler_t::keep: { // copy undumped chars to string buffer - for (int j = 0; j < undumped_chars; ++j) + for (std::size_t j = 0; j < undumped_chars; ++j) { string_buffer[bytes++] = s[bytes_after_last_accept + j]; } @@ -19194,7 +19194,7 @@ class serializer case error_handler_t::keep: { // copy undumped chars to string buffer - for (int j = 0; j < undumped_chars; ++j) + for (std::size_t j = 0; j < undumped_chars; ++j) { string_buffer[bytes++] = s[bytes_after_last_accept + j]; }