From 9b9725ded19dcf9e7c61b7bf6acf397f1b6d842f Mon Sep 17 00:00:00 2001 From: Carol Yang Date: Mon, 1 Nov 2021 09:59:19 -0700 Subject: [PATCH] Only print the size of TLV fields --- .../ota-requestor-common/ExampleOTARequestor.cpp | 3 +-- src/app/clusters/ota-provider/ota-provider.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/ota-requestor-app/ota-requestor-common/ExampleOTARequestor.cpp b/examples/ota-requestor-app/ota-requestor-common/ExampleOTARequestor.cpp index c3566d331735f2..e3164884823c44 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ExampleOTARequestor.cpp +++ b/examples/ota-requestor-app/ota-requestor-common/ExampleOTARequestor.cpp @@ -98,8 +98,7 @@ EmberAfStatus ExampleOTARequestor::HandleAnnounceOTAProvider( ChipLogDetail(SoftwareUpdate, " AnnouncementReason: %" PRIu8, announcementReason); if (commandData.metadataForNode.HasValue()) { - ChipLogDetail(SoftwareUpdate, " MetadataForNode: %.*s", static_cast(commandData.metadataForNode.Value().size()), - commandData.metadataForNode.Value().data()); + ChipLogDetail(SoftwareUpdate, " MetadataForNode: %zu", commandData.metadataForNode.Value().size()); } // If reason is URGENT_UPDATE_AVAILABLE, we start OTA immediately. Otherwise, respect the timer value set in mOtaStartDelayMs. diff --git a/src/app/clusters/ota-provider/ota-provider.cpp b/src/app/clusters/ota-provider/ota-provider.cpp index b526a9a7c01c8e..52855f003e1949 100644 --- a/src/app/clusters/ota-provider/ota-provider.cpp +++ b/src/app/clusters/ota-provider/ota-provider.cpp @@ -192,7 +192,7 @@ bool emberAfOtaSoftwareUpdateProviderClusterQueryImageCallback(app::CommandHandl ChipLogDetail(Zcl, " HardwareVersion: %" PRIu16, hardwareVersion); ChipLogDetail(Zcl, " Location: %.*s", static_cast(location.size()), location.data()); ChipLogDetail(Zcl, " RequestorCanConsent: %" PRIu8, requestorCanConsent); - ChipLogDetail(Zcl, " MetadataForProvider: %.*s", static_cast(metadataForProvider.size()), metadataForProvider.data()); + ChipLogDetail(Zcl, " MetadataForProvider: %zu", metadataForProvider.size()); if (location.size() != kLocationLen) {