From 4215eb6003c88d0bd1a2b40227126d5c771c3017 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Thu, 21 Jun 2018 22:05:27 -0400 Subject: [PATCH] Debugger: Fix some broken comparisons. * Missing parentheses in integer comparison inversion * !=, not ! at the beginning of expression Spotted by Clang. --- src/kits/debugger/elf/ElfFile.cpp | 2 +- src/kits/debugger/ids/FunctionID.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kits/debugger/elf/ElfFile.cpp b/src/kits/debugger/elf/ElfFile.cpp index 9b2e413918..d375659788 100644 --- a/src/kits/debugger/elf/ElfFile.cpp +++ b/src/kits/debugger/elf/ElfFile.cpp @@ -224,7 +224,7 @@ ElfFile::Init(const char* fileName) return bytesRead < 0 ? errno : B_ERROR; // magic - if (!memcmp(elfIdent, ELFMAG, 4) == 0) + if (!(memcmp(elfIdent, ELFMAG, 4) == 0)) return B_ERROR; // endianess diff --git a/src/kits/debugger/ids/FunctionID.cpp b/src/kits/debugger/ids/FunctionID.cpp index 025767dffe..c2d89b7b71 100644 --- a/src/kits/debugger/ids/FunctionID.cpp +++ b/src/kits/debugger/ids/FunctionID.cpp @@ -63,7 +63,7 @@ FunctionID::ComputeHashValue() const bool FunctionID::IsValid() const { - return !fPath.Length() == 0 && !fFunctionName.Length() == 0; + return fPath.Length() != 0 && fFunctionName.Length() != 0; }