checkbufferoverrun : a bug fix and a better use of Match

This commit is contained in:
Daniel Marjamäki 2008-12-23 07:50:44 +00:00
parent 85239c48a9
commit e7d6809cf4
1 changed files with 2 additions and 2 deletions

View File

@ -191,7 +191,7 @@ void CheckBufferOverrunClass::CheckBufferOverrun_CheckScope(const TOKEN *tok, co
continue;
// Goto the end of the for loop..
while ( tok && tok2->str() != ")" )
while ( tok2 && tok2->str() != ")" )
tok2 = tok2->next();
if ( !tok2 || !tok2->tokAt(5) )
break;
@ -311,7 +311,7 @@ void CheckBufferOverrunClass::CheckBufferOverrun_CheckScope(const TOKEN *tok, co
else if ( ftok->str() == "," )
par--;
else if ( par==1 && parlevel==1 && (TOKEN::Match(ftok, "%var% ,") || TOKEN::Match(ftok, "%var% )")) )
else if ( par==1 && parlevel==1 && TOKEN::Match(ftok, "%var% [,)]") )
{
// Parameter name..
const char *parname[2];