Fixed #3427 (False positive: (error) Dangerous usage of c_str(). The returned value by c_str() is invalid after this call.)

This commit is contained in:
PKEuS 2011-12-18 19:44:38 +01:00 committed by Daniel Marjamäki
parent 0205582161
commit b6b97fa43d
1 changed files with 1 additions and 1 deletions

View File

@ -1000,7 +1000,7 @@ void CheckStl::missingComparisonError(const Token *incrementToken1, const Token
static bool isLocal(const SymbolDatabase* symbolDatabase, unsigned int varid)
{
const Variable* var = symbolDatabase->getVariableFromVarId(varid);
return var && var->isLocal();
return var && !var->isStatic() && var->isLocal();
}
void CheckStl::string_c_str()