From 344b6bf4349287478a18154e445df0220b7a89d7 Mon Sep 17 00:00:00 2001 From: Eric Sesterhenn Date: Fri, 30 Apr 2010 18:08:32 +0200 Subject: [PATCH] Fixed #1636 (Fix false positive with strncpy termination check) --- lib/checkbufferoverrun.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/checkbufferoverrun.cpp b/lib/checkbufferoverrun.cpp index 5de82a88c..8faa7f707 100644 --- a/lib/checkbufferoverrun.cpp +++ b/lib/checkbufferoverrun.cpp @@ -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)