From e4c4db5cf9f54a7c4a156d4af07ebbb979a43b88 Mon Sep 17 00:00:00 2001 From: Florent Rougon Date: Fri, 28 Apr 2017 22:11:23 +0200 Subject: [PATCH] strutils::unescape(): minor change Use static_cast for clarity when adding an int to an std::string with std::string::operator+=(). --- simgear/misc/strutils.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/simgear/misc/strutils.cxx b/simgear/misc/strutils.cxx index 9b4066ac..18f0b10b 100644 --- a/simgear/misc/strutils.cxx +++ b/simgear/misc/strutils.cxx @@ -670,14 +670,14 @@ std::string unescape(const char* s) for (/* empty */; isxdigit(*s); s++) { v = v * 16 + (isdigit(*s) ? *s - '0' : 10 + tolower(*s) - 'a'); } - r += v; + r += static_cast(v); continue; } else if (*s >= '0' && *s <= '7') { int v = *s++ - '0'; for (int i = 0; i < 2 && *s >= '0' && *s <= '7'; i++, s++) v = v * 8 + *s - '0'; - r += v; + r += static_cast(v); continue; } else {