diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index f35caf5c5..01c5130a1 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -339,7 +339,8 @@ void CppCheck::checkFile(const std::string &code, const char FileName[]) } // Update the _dependencies.. - _dependencies.insert( _tokenizer.getFiles()->begin()+1, _tokenizer.getFiles()->end() ); + if (_tokenizer.getFiles()->size() >= 2) + _dependencies.insert(_tokenizer.getFiles()->begin()+1, _tokenizer.getFiles()->end()); // call all "runChecks" in all registered Check classes for (std::list::iterator it = Check::instances().begin(); it != Check::instances().end(); ++it) {