From e7d6809cf4da28a1ddec8d85f3f82a8c31b960bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 23 Dec 2008 07:50:44 +0000 Subject: [PATCH] checkbufferoverrun : a bug fix and a better use of Match --- checkbufferoverrun.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/checkbufferoverrun.cpp b/checkbufferoverrun.cpp index 5a35cd787..f1ebbe63d 100644 --- a/checkbufferoverrun.cpp +++ b/checkbufferoverrun.cpp @@ -191,7 +191,7 @@ void CheckBufferOverrunClass::CheckBufferOverrun_CheckScope(const TOKEN *tok, co continue; // Goto the end of the for loop.. - while ( tok && tok2->str() != ")" ) + while ( tok2 && tok2->str() != ")" ) tok2 = tok2->next(); if ( !tok2 || !tok2->tokAt(5) ) break; @@ -311,7 +311,7 @@ void CheckBufferOverrunClass::CheckBufferOverrun_CheckScope(const TOKEN *tok, co else if ( ftok->str() == "," ) par--; - else if ( par==1 && parlevel==1 && (TOKEN::Match(ftok, "%var% ,") || TOKEN::Match(ftok, "%var% )")) ) + else if ( par==1 && parlevel==1 && TOKEN::Match(ftok, "%var% [,)]") ) { // Parameter name.. const char *parname[2];