From b0ce3e4c0cdc27b11fa050e7eb8045762342478b Mon Sep 17 00:00:00 2001 From: fuzzelhjb Date: Fri, 31 Jan 2020 14:10:27 +0100 Subject: [PATCH] Support clang tidy (#2512) --- lib/cppcheck.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index 12a9ef7f5..b12ce70fb 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -1398,6 +1398,8 @@ void CppCheck::analyseClangTidy(const ImportProject::FileSettings &fileSettings const std::size_t endNamePos = line.rfind(":", endLinePos - 1); const std::size_t endMsgTypePos = line.find(':', endColumnPos + 2); const std::size_t endErrorPos = line.rfind('[', std::string::npos); + if(endLinePos==std::string::npos || endNamePos==std::string::npos || endMsgTypePos==std::string::npos || endErrorPos==std::string::npos) + continue; const std::string lineNumString = line.substr(endNamePos + 1, endLinePos - endNamePos - 1); const std::string columnNumString = line.substr(endLinePos + 1, endColumnPos - endLinePos - 1);