simplifyIfAddBraces : Fixed segmentation fault

This commit is contained in:
Daniel Marjamäki 2008-12-22 18:00:54 +00:00
parent a148e67168
commit 30c86f7107
1 changed files with 1 additions and 1 deletions

View File

@ -1220,7 +1220,7 @@ bool Tokenizer::simplifyIfAddBraces()
{ {
bool ret = false; bool ret = false;
for ( TOKEN *tok = _tokens; tok; tok = tok->next() ) for ( TOKEN *tok = _tokens; tok; tok = tok ? tok->next() : NULL )
{ {
if ( ! TOKEN::Match(tok, "if|for|while (") ) if ( ! TOKEN::Match(tok, "if|for|while (") )
continue; continue;