diff --git a/cli/cppcheckexecutor.cpp b/cli/cppcheckexecutor.cpp index be66725f2..0505f0a41 100644 --- a/cli/cppcheckexecutor.cpp +++ b/cli/cppcheckexecutor.cpp @@ -158,12 +158,11 @@ bool CppCheckExecutor::parseFromArgs(CppCheck *cppcheck, int argc, const char* c return false; } - if (!_files.empty()) { - return true; - } else { + if (_files.empty()) { std::cout << "cppcheck: error: no files to check - all paths ignored." << std::endl; return false; } + return true; } int CppCheckExecutor::check(int argc, const char* const argv[]) diff --git a/lib/checkbufferoverrun.cpp b/lib/checkbufferoverrun.cpp index 36f78e664..a446257aa 100644 --- a/lib/checkbufferoverrun.cpp +++ b/lib/checkbufferoverrun.cpp @@ -1597,10 +1597,9 @@ void CheckBufferOverrun::checkInsecureCmdLineArgs() std::size_t functions = symbolDatabase->functionScopes.size(); for (std::size_t i = 0; i < functions; ++i) { - const Scope * scope = symbolDatabase->functionScopes[i]; - Function * j = scope->function; - if (j) { - const Token* tok = j->token; + const Function * function = symbolDatabase->functionScopes[i]->function; + if (function) { + const Token* tok = function->token; // Get the name of the argv variable unsigned int varid = 0;