From 8a05be34f8391f74116071db1b713fac4b0ba085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 3 Nov 2018 19:41:25 +0100 Subject: [PATCH] Fix Cppcheck shadow variable warning --- lib/analyzerinfo.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/analyzerinfo.cpp b/lib/analyzerinfo.cpp index b34140188..63c17b723 100644 --- a/lib/analyzerinfo.cpp +++ b/lib/analyzerinfo.cpp @@ -102,11 +102,11 @@ std::string AnalyzerInformation::getAnalyzerInfoFile(const std::string &buildDir std::ifstream fin(files); if (fin.is_open()) { std::string line; - const std::string endsWith(':' + cfg + ':' + sourcefile); + const std::string end(':' + cfg + ':' + sourcefile); while (std::getline(fin,line)) { - if (line.size() <= endsWith.size() + 2U) + if (line.size() <= end.size() + 2U) continue; - if (line.compare(line.size()-endsWith.size(), endsWith.size(), endsWith) != 0) + if (!endsWith(line, end.c_str(), end.size())) continue; std::ostringstream ostr; ostr << buildDir << '/' << line.substr(0,line.find(':'));