From eda18004bd51a56c925e11e71a588ee90ca07363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 22 Apr 2010 19:58:44 +0200 Subject: [PATCH] Cleanup CheckBufferOverrun --- lib/checkbufferoverrun.cpp | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/lib/checkbufferoverrun.cpp b/lib/checkbufferoverrun.cpp index b6f558898..33b6d4caf 100644 --- a/lib/checkbufferoverrun.cpp +++ b/lib/checkbufferoverrun.cpp @@ -932,10 +932,6 @@ void CheckBufferOverrun::checkScope(const Token *tok, const ArrayInfo &arrayInfo checkFunctionCall(*tok, 2, arrayInfo); - if (Token::Match(tok, "memset|memcpy|memmove|memcmp|strncpy|fgets ( %varid% , %any% , %any% )", arrayInfo.varid) || - Token::Match(tok, "memset|memcpy|memmove|memcmp|fgets ( %var% , %varid% , %any% )", arrayInfo.varid)) - { - if (_settings->_checkCodingStyle) { // check for strncpy which is not terminated @@ -960,7 +956,6 @@ void CheckBufferOverrun::checkScope(const Token *tok, const ArrayInfo &arrayInfo } } } - } // Dangerous usage of strncat.. if (Token::Match(tok, "strncpy|strncat ( %varid% , %any% , %num% )", arrayInfo.varid)) @@ -1060,19 +1055,6 @@ void CheckBufferOverrun::checkGlobalAndLocalVariable() continue; } - /* - if (Token::Match(tok, "%type% *| %var% [ %num% ] [;=]")) - { - unsigned int varpos = 1; - if (tok->next()->str() == "*") - ++varpos; - size = MathLib::toLongNumber(tok->strAt(varpos + 2)); - type = tok->strAt(varpos - 1); - varid = tok->tokAt(varpos)->varId(); - nextTok = varpos + 5; - } - else - */ if (Token::Match(tok, "%type% *| %var% [ %var% ] [;=]")) { unsigned int varpos = 1;