checkbufferoverrun.cpp: get rid of Match() usage with varid 0.

This commit is contained in:
Slava Semushin 2009-08-09 01:09:45 +07:00
parent 0f96299d87
commit eebb1671a5
1 changed files with 9 additions and 6 deletions

View File

@ -248,6 +248,8 @@ void CheckBufferOverrun::checkScope(const Token *tok, const char *varname[], con
else
continue;
if (counter_varid)
{
if (Token::Match(tok2, "%varid% < %num% ;", counter_varid))
{
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);
}
}
// Get index variable and stopsize.
const char *strindex = tok2->str().c_str();