From 806dbf77b6523258fcc0f055d2f231850dcb12d5 Mon Sep 17 00:00:00 2001 From: fschwa <70687497+fschwa@users.noreply.github.com> Date: Tue, 6 Apr 2021 16:57:27 +0200 Subject: [PATCH] use size() instead of hard-coded length value (#3199) Co-authored-by: Frederik Schwarzer --- lib/preprocessor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/preprocessor.cpp b/lib/preprocessor.cpp index 030794ef2..8f3c04616 100644 --- a/lib/preprocessor.cpp +++ b/lib/preprocessor.cpp @@ -96,7 +96,7 @@ static bool parseInlineSuppressionCommentToken(const simplecpp::Token *tok, std: return false; // skip spaces after "cppcheck-suppress" - const std::string::size_type pos2 = comment.find_first_not_of(" ", pos1+17); + const std::string::size_type pos2 = comment.find_first_not_of(" ", pos1+cppchecksuppress.size()); if (pos2 == std::string::npos) return false;