Fix issue detected by Coverity (ternary operator false expression is unreachable)

This commit is contained in:
Daniel Marjamäki 2017-07-31 17:55:15 +02:00
parent c4ee9799bc
commit a024f339dd
1 changed files with 1 additions and 1 deletions

View File

@ -131,7 +131,7 @@ void Preprocessor::setDirectives(const simplecpp::TokenList &tokens)
}
for (std::vector<const simplecpp::TokenList *>::const_iterator it = list.begin(); it != list.end(); ++it) {
for (const simplecpp::Token *tok = (*it)->cfront(); tok; tok = tok ? tok->next : nullptr) {
for (const simplecpp::Token *tok = (*it)->cfront(); tok; tok = tok->next) {
if ((tok->op != '#') || (tok->previous && tok->previous->location.line == tok->location.line))
continue;
if (tok->next && tok->next->str == "endfile")