checkbufferoverrun.cpp: get rid of Match() usage with varid 0.
This commit is contained in:
parent
0f96299d87
commit
eebb1671a5
|
@ -248,6 +248,8 @@ void CheckBufferOverrun::checkScope(const Token *tok, const char *varname[], con
|
||||||
else
|
else
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (counter_varid)
|
||||||
|
{
|
||||||
if (Token::Match(tok2, "%varid% < %num% ;", counter_varid))
|
if (Token::Match(tok2, "%varid% < %num% ;", counter_varid))
|
||||||
{
|
{
|
||||||
max_counter_value = MathLib::toString<long>(atol(tok2->strAt(2)) - 1);
|
max_counter_value = MathLib::toString<long>(atol(tok2->strAt(2)) - 1);
|
||||||
|
@ -256,6 +258,7 @@ void CheckBufferOverrun::checkScope(const Token *tok, const char *varname[], con
|
||||||
{
|
{
|
||||||
max_counter_value = tok2->strAt(2);
|
max_counter_value = tok2->strAt(2);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Get index variable and stopsize.
|
// Get index variable and stopsize.
|
||||||
const char *strindex = tok2->str().c_str();
|
const char *strindex = tok2->str().c_str();
|
||||||
|
|
Loading…
Reference in New Issue