From ecadcdb5938fb17ef238dcad031de0de37ccf57f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20M=C3=B6ller?= Date: Thu, 31 May 2018 16:36:16 +0200 Subject: [PATCH] added char cast should fix the GCC unittest --- include/nlohmann/detail/output/serializer.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/nlohmann/detail/output/serializer.hpp b/include/nlohmann/detail/output/serializer.hpp index f6fa152a..19ab9894 100644 --- a/include/nlohmann/detail/output/serializer.hpp +++ b/include/nlohmann/detail/output/serializer.hpp @@ -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(s.back())); JSON_THROW(type_error::create(316, "incomplete UTF-8 string; last byte: 0x" + sn)); } }