Coverity detected useless function call, cleanup code

This commit is contained in:
Daniel Marjamäki 2017-08-01 12:45:37 +02:00
parent 0c8a899f59
commit 058c439b2a
1 changed files with 1 additions and 9 deletions

View File

@ -1377,17 +1377,9 @@ void CheckBufferOverrun::checkStructVariable()
if (Token::Match(tok3->next(), "%var% ;")) if (Token::Match(tok3->next(), "%var% ;"))
varname[0] = &tok3->strAt(1); varname[0] = &tok3->strAt(1);
else if (isArrayOfStruct(tok3,posOfSemicolon)) { else if (isArrayOfStruct(tok3,posOfSemicolon))
varname[0] = &tok3->strAt(1); varname[0] = &tok3->strAt(1);
int pos = 2;
for (int k = 0 ; k < posOfSemicolon; k++) {
for (int index = pos; index < (pos + 3); index++)
tok3->strAt(index);
pos += 3;
}
}
// Declare pointer or reference: Fred *fred1 // Declare pointer or reference: Fred *fred1
else if (Token::Match(tok3->next(), "*|& %var% [,);=]")) else if (Token::Match(tok3->next(), "*|& %var% [,);=]"))
varname[0] = &tok3->strAt(2); varname[0] = &tok3->strAt(2);