diff --git a/lib/checkmemoryleak.cpp b/lib/checkmemoryleak.cpp index 5b7c1508c..ceecacdf5 100644 --- a/lib/checkmemoryleak.cpp +++ b/lib/checkmemoryleak.cpp @@ -455,7 +455,7 @@ void CheckMemoryLeakInFunction::parse_noreturn() tok = tok->link(); if (tok->str() == "(") { - const std::string function_name((tok->previous() && tok->previous()->isName()) ? tok->strAt(-1) : ""); + const std::string function_name((tok->previous() && tok->previous()->isName()) ? tok->strAt(-1).c_str() : ""); tok = tok->link(); diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 6cd818386..509b415ed 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -4801,8 +4801,8 @@ bool Tokenizer::simplifyCalculations() MathLib::isInt(tok->str()) && MathLib::isInt(tok->tokAt(2)->str())) { - const std::string prev(tok->previous() ? tok->strAt(-1) : ""); - const std::string after(tok->tokAt(3) ? tok->strAt(3) : ""); + const std::string prev(tok->previous() ? tok->strAt(-1).c_str() : ""); + const std::string after(tok->tokAt(3) ? tok->strAt(3).c_str() : ""); if ((prev == "(" || prev == "&&" || prev == "||") && (after == ")" || after == "&&" || after == "||")) { const int op1(MathLib::toLongNumber(tok->str()));