Check in a clang-tidy
This should've been done when we first created the repo, but better late
than never.
Signed-off-by: Ed Tanous <edtanous@google.com>
Signed-off-by: John Edward Broadbent <jebr@google.com>
Change-Id: I68da1d13167ec94f9d008dea307c9f23a991d42c
diff --git a/src/erase/zero.cpp b/src/erase/zero.cpp
index 2c0d615..2c5a6f5 100644
--- a/src/erase/zero.cpp
+++ b/src/erase/zero.cpp
@@ -51,7 +51,7 @@
stdplus::fd::open(devPath, stdplus::fd::OpenAccess::ReadOnly);
uint64_t currentIndex = 0;
- std::array<std::byte, blockSize> readArr;
+ std::array<std::byte, blockSize> readArr{};
const std::array<const std::byte, blockSize> blockOfZeros{};
while (currentIndex < driveSize)
@@ -70,7 +70,7 @@
std::string("eStorageD.1.0.EraseFailure"));
throw InternalFailure();
}
- if (memcmp(readArr.data(), blockOfZeros.data(), readSize))
+ if (memcmp(readArr.data(), blockOfZeros.data(), readSize) != 0)
{
lg2::error("Estoraged erase zeros block is not zero",
"REDFISH_MESSAGE_ID",