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:
parent
0205582161
commit
b6b97fa43d
|
@ -1000,7 +1000,7 @@ void CheckStl::missingComparisonError(const Token *incrementToken1, const Token
|
||||||
static bool isLocal(const SymbolDatabase* symbolDatabase, unsigned int varid)
|
static bool isLocal(const SymbolDatabase* symbolDatabase, unsigned int varid)
|
||||||
{
|
{
|
||||||
const Variable* var = symbolDatabase->getVariableFromVarId(varid);
|
const Variable* var = symbolDatabase->getVariableFromVarId(varid);
|
||||||
return var && var->isLocal();
|
return var && !var->isStatic() && var->isLocal();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheckStl::string_c_str()
|
void CheckStl::string_c_str()
|
||||||
|
|
Loading…
Reference in New Issue