From 9d71c3d09deb8bdc6f4365c718c00ecc5aad2874 Mon Sep 17 00:00:00 2001 From: Michael Sandstedt Date: Tue, 25 Jan 2022 17:39:19 -0600 Subject: [PATCH] per bzbarsky-apple, fix name.compare for kIdentityNull --- examples/chip-tool/commands/common/CHIPCommand.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/chip-tool/commands/common/CHIPCommand.cpp b/examples/chip-tool/commands/common/CHIPCommand.cpp index 6f4cd763598d8e..c5fcf09ecc7135 100644 --- a/examples/chip-tool/commands/common/CHIPCommand.cpp +++ b/examples/chip-tool/commands/common/CHIPCommand.cpp @@ -103,7 +103,7 @@ void CHIPCommand::SetIdentity(const char * identity) { std::string name = std::string(identity); if (name.compare(kIdentityAlpha) != 0 && name.compare(kIdentityBeta) != 0 && name.compare(kIdentityGamma) != 0 && - name.compare(kIdentityNull)) + name.compare(kIdentityNull) != 0) { ChipLogError(chipTool, "Unknown commissioner name: %s. Supported names are [%s, %s, %s]", name.c_str(), kIdentityAlpha, kIdentityBeta, kIdentityGamma); @@ -117,7 +117,7 @@ std::string CHIPCommand::GetIdentity() { std::string name = mCommissionerName.HasValue() ? mCommissionerName.Value() : kIdentityAlpha; if (name.compare(kIdentityAlpha) != 0 && name.compare(kIdentityBeta) != 0 && name.compare(kIdentityGamma) != 0 && - name.compare(kIdentityNull)) + name.compare(kIdentityNull) != 0) { ChipLogError(chipTool, "Unknown commissioner name: %s. Supported names are [%s, %s, %s]", name.c_str(), kIdentityAlpha, kIdentityBeta, kIdentityGamma);