refactoring: changed the severity for strncatUsage from possibleError to style

This commit is contained in:
Daniel Marjamäki 2010-05-02 09:54:08 +02:00
parent 883d462553
commit 0415560912
2 changed files with 4 additions and 4 deletions

View File

@ -136,10 +136,10 @@ void CheckBufferOverrun::dangerousStdCin(const Token *tok)
void CheckBufferOverrun::strncatUsage(const Token *tok)
{
if (_settings && _settings->inconclusive == false)
if (_settings && !_settings->_checkCodingStyle)
return;
reportError(tok, Severity::possibleError, "strncatUsage", "Dangerous usage of strncat. Tip: the 3rd parameter means maximum number of characters to append");
reportError(tok, Severity::style, "strncatUsage", "Dangerous usage of strncat. Tip: the 3rd parameter means maximum number of characters to append");
}
void CheckBufferOverrun::outOfBounds(const Token *tok, const std::string &what)

View File

@ -1631,7 +1631,7 @@ private:
" strncpy(str, a, 10);\n"
" strncat(str, b, 10);\n"
"}\n");
ASSERT_EQUALS("[test.cpp:5]: (possible error) Dangerous usage of strncat. Tip: the 3rd parameter means maximum number of characters to append\n", errout.str());
ASSERT_EQUALS("[test.cpp:5]: (style) Dangerous usage of strncat. Tip: the 3rd parameter means maximum number of characters to append\n", errout.str());
}
void strncat2()
@ -1641,7 +1641,7 @@ private:
" char str[5];\n"
" strncat(str, a, 5);\n"
"}\n");
ASSERT_EQUALS("[test.cpp:4]: (possible error) Dangerous usage of strncat. Tip: the 3rd parameter means maximum number of characters to append\n", errout.str());
ASSERT_EQUALS("[test.cpp:4]: (style) Dangerous usage of strncat. Tip: the 3rd parameter means maximum number of characters to append\n", errout.str());
}