diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index fd7e26856..824c9cfa1 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -272,8 +272,10 @@ static std::string executeAddon(const AddonInfo &addonInfo, std::istringstream istr(result); std::string line; while (std::getline(istr, line)) { - if (line.compare(0,9,"Checking ", 0, 9) != 0 && !line.empty() && line[0] != '{') + if (line.compare(0,9,"Checking ", 0, 9) != 0 && !line.empty() && line[0] != '{') { + result.erase(result.find_last_not_of('\n') + 1, std::string::npos); // Remove trailing newlines throw InternalError(nullptr, "Failed to execute '" + pythonExe + " " + args + "'. " + result); + } } // Valid results