Fixed cppcheck warning

This commit is contained in:
Jan Möbius
2023-08-23 14:08:58 +02:00
parent 21eff4fb5e
commit 29a5a5f61e

View File

@@ -229,7 +229,10 @@ replace_extension( std::string& _s, const std::string& _e )
if (dot == std::string::npos)
{ _s += "." + _e; }
else
{ _s = _s.substr(0,dot+1)+_e; }
{
const std::string temp_name = _s.substr(0,dot+1);
_s = temp_name + _e;
}
return _s;
}