Fixed #775 (###### If you see this, there is a bug ###### Token::Match() - varid was 0)
http://sourceforge.net/apps/trac/cppcheck/ticket/775
This commit is contained in:
parent
8dc9528a74
commit
9a48efec00
|
@ -252,8 +252,9 @@ void CheckBufferOverrun::checkScope(const Token *tok, const char *varname[], con
|
|||
continue;
|
||||
|
||||
int value = 0;
|
||||
if (counter_varid)
|
||||
{
|
||||
if (counter_varid == 0)
|
||||
continue;
|
||||
|
||||
if (Token::Match(tok2, "%varid% < %num% ;", counter_varid))
|
||||
{
|
||||
value = std::atoi(tok2->strAt(2));
|
||||
|
@ -264,7 +265,6 @@ void CheckBufferOverrun::checkScope(const Token *tok, const char *varname[], con
|
|||
value = std::atoi(tok2->strAt(2)) + 1;
|
||||
max_counter_value = tok2->strAt(2);
|
||||
}
|
||||
}
|
||||
|
||||
// Get index variable and stopsize.
|
||||
const char *strindex = tok2->str().c_str();
|
||||
|
|
Loading…
Reference in New Issue