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 // we finish reading, but do not accept: string was incomplete
std::string sn(3,'\0'); 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)); JSON_THROW(type_error::create(316, "incomplete UTF-8 string; last byte: 0x" + sn));
} }
} }