1
0
mirror of https://github.com/nlohmann/json.git synced 2025-08-06 07:02:42 +03:00

added char cast

should fix the GCC unittest
This commit is contained in:
Matthias Möller
2018-05-31 16:36:16 +02:00
parent 48656a49f5
commit ecadcdb593

View File

@@ -415,7 +415,7 @@ class serializer
{
// we finish reading, but do not accept: string was incomplete
std::string sn(3,'\0');
snprintf(&sn[0], sn.size(), "%.2X", s.back());
snprintf(&sn[0], sn.size(), "%.2X", static_cast<uint8_t>(s.back()));
JSON_THROW(type_error::create(316, "incomplete UTF-8 string; last byte: 0x" + sn));
}
}