cppcheck: The '&&' should be '||' when checking if a check should be called
This commit is contained in:
parent
e691ade8e6
commit
de2675b46f
|
@ -313,7 +313,7 @@ void CppCheck::checkFile(const std::string &code, const char FileName[])
|
||||||
|
|
||||||
// Memory leak
|
// Memory leak
|
||||||
CheckMemoryLeakClass checkMemoryLeak(&_tokenizer, _settings, this);
|
CheckMemoryLeakClass checkMemoryLeak(&_tokenizer, _settings, this);
|
||||||
if (ErrorMessage::memleak() && ErrorMessage::mismatchAllocDealloc())
|
if (ErrorMessage::memleak() || ErrorMessage::mismatchAllocDealloc())
|
||||||
checkMemoryLeak.CheckMemoryLeak();
|
checkMemoryLeak.CheckMemoryLeak();
|
||||||
|
|
||||||
// Check that all class constructors are ok.
|
// Check that all class constructors are ok.
|
||||||
|
@ -325,7 +325,7 @@ void CppCheck::checkFile(const std::string &code, const char FileName[])
|
||||||
checkClass.virtualDestructor();
|
checkClass.virtualDestructor();
|
||||||
|
|
||||||
// Array index out of bounds / Buffer overruns..
|
// Array index out of bounds / Buffer overruns..
|
||||||
if (ErrorMessage::arrayIndexOutOfBounds(_settings) && ErrorMessage::bufferOverrun(_settings))
|
if (ErrorMessage::arrayIndexOutOfBounds(_settings) || ErrorMessage::bufferOverrun(_settings))
|
||||||
checkBufferOverrun.bufferOverrun();
|
checkBufferOverrun.bufferOverrun();
|
||||||
|
|
||||||
// Dangerous functions, such as 'gets' and 'scanf'
|
// Dangerous functions, such as 'gets' and 'scanf'
|
||||||
|
|
Loading…
Reference in New Issue