From 1f97e0e5df1a3d2b6eb748b9a2290b83562b4861 Mon Sep 17 00:00:00 2001 From: Zachary Blair Date: Fri, 26 Apr 2013 20:06:17 -0700 Subject: [PATCH] Ticket #4510 - Reduced the scope of the safeFunctions variable to avoid a cppcheck style issue --- lib/checknullpointer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/checknullpointer.cpp b/lib/checknullpointer.cpp index 2d8c1e68d..d62ffe9b2 100644 --- a/lib/checknullpointer.cpp +++ b/lib/checknullpointer.cpp @@ -1200,11 +1200,11 @@ void CheckNullPointer::nullConstantDereference() */ void CheckNullPointer::removeAssignedVarFromSet(const Token* tok, std::set& pointerArgs) { - // Common functions that are known NOT to modify their pointer argument - const char safeFunctions[] = "printf|sprintf|fprintf|vprintf"; - // If a pointer's address is passed into a function, stop considering it if (Token::Match(tok->previous(), "[;{}] %var% (")) { + // Common functions that are known NOT to modify their pointer argument + const char safeFunctions[] = "printf|sprintf|fprintf|vprintf"; + const Token* endParen = tok->next()->link(); for (const Token* tok2 = tok->next(); tok2 != endParen; tok2 = tok2->next()) { if (tok2->isName() && tok2->varId() > 0 && !Token::Match(tok, safeFunctions)) {