Fix possible null pointer dereference cppcheck warning. (#1056)

This commit is contained in:
IOBYTE 2018-01-24 15:19:52 -05:00 committed by amai2012
parent 61ef48bcad
commit 8ce496a127
1 changed files with 1 additions and 1 deletions

View File

@ -99,7 +99,7 @@ const Token * Tokenizer::isFunctionHead(const Token *tok, const std::string &end
tok = tok->next(); tok = tok->next();
while (tok && tok->str() == "[") while (tok && tok->str() == "[")
tok = tok->link()->next(); tok = tok->link()->next();
return (endsWith.find(tok->str()) != std::string::npos) ? tok : nullptr; return (tok && endsWith.find(tok->str()) != std::string::npos) ? tok : nullptr;
} }
if (cpp && tok->str() == ")") { if (cpp && tok->str() == ")") {
tok = tok->next(); tok = tok->next();