#4664: using Token::nextArgument() and std::string &

This commit is contained in:
Ettl Martin 2013-03-20 11:53:25 +01:00
parent dd155b57e4
commit a08083a342
1 changed files with 2 additions and 2 deletions

View File

@ -2248,8 +2248,8 @@ void CheckBufferOverrun::writeOutsideBufferSize()
for (std::size_t i = 0; i < functions; ++i) {
const Scope * scope = symbolDatabase->functionScopes[i];
for (const Token *tok = scope->classStart; tok && tok != scope->classEnd; tok = tok->next()) {
if (Token::Match(tok, "pwrite|write ( %any% , %str% , %num%")) {
const std::string functionName(tok->str());
if (Token::Match(tok, "pwrite|write (") && Token::Match(tok->tokAt(2)->nextArgument(), "%str% , %num%")) {
const std::string & functionName(tok->str());
tok = tok->tokAt(4); // set tokenptr to %str% parameter
const std::size_t stringLength = Token::getStrLength(tok);
tok = tok->tokAt(2); // set tokenptr to %num% parameter