diff --git a/lib/checkautovariables.cpp b/lib/checkautovariables.cpp index e85796d61..2fc6efa0b 100644 --- a/lib/checkautovariables.cpp +++ b/lib/checkautovariables.cpp @@ -442,7 +442,7 @@ static int getPointerDepth(const Token *tok) int n = 0; std::pair decl = Token::typeDecl(tok); for (const Token* tok2 = decl.first; tok2 != decl.second; tok2 = tok2->next()) - if (Token::simpleMatch(tok, "*")) + if (Token::simpleMatch(tok2, "*")) n++; return n; }