diff --git a/cli/cppcheckexecutor.cpp b/cli/cppcheckexecutor.cpp index 48a5663ad..14b3cdeb7 100644 --- a/cli/cppcheckexecutor.cpp +++ b/cli/cppcheckexecutor.cpp @@ -1170,7 +1170,7 @@ bool CppCheckExecutor::tryLoadLibrary(Library& destination, const char* basepath * Execute a shell command and read the output from it. Returns true if command terminated successfully. */ // cppcheck-suppress passedByValue -bool CppCheckExecutor::executeCommand(std::string exe, std::vector args, std::string redirect, std::string *output) +bool CppCheckExecutor::executeCommand(std::string exe, std::vector args, const std::string &redirect, std::string *output) { output->clear(); diff --git a/cli/cppcheckexecutor.h b/cli/cppcheckexecutor.h index ca3a09aac..63d853598 100644 --- a/cli/cppcheckexecutor.h +++ b/cli/cppcheckexecutor.h @@ -111,7 +111,7 @@ public: /** * Execute a shell command and read the output from it. Returns true if command terminated successfully. */ - static bool executeCommand(std::string exe, std::vector args, std::string redirect, std::string *output); + static bool executeCommand(std::string exe, std::vector args, const std::string &redirect, std::string *output); protected: