Fixed #1636 (Fix false positive with strncpy termination check)

This commit is contained in:
Eric Sesterhenn 2010-04-30 18:08:32 +02:00 committed by Daniel Marjamäki
parent b261e5df25
commit 344b6bf434
1 changed files with 1 additions and 1 deletions

View File

@ -1009,7 +1009,7 @@ void CheckBufferOverrun::checkScope(const Token *tok, const ArrayInfo &arrayInfo
if (_settings->_checkCodingStyle)
{
// check for strncpy which is not terminated
if (Token::Match(tok, "strncpy ( %varid% , %any% , %num% )", arrayInfo.varid))
if ((Token::Match(tok, "strncpy ( %varid% , %var% , %num% )", arrayInfo.varid)))
{
// strncpy takes entire variable length as input size
if ((unsigned int)MathLib::toLongNumber(tok->strAt(6)) >= total_size)