From 236198806a4a3777afeee7b31697ef1711a33c4f Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 2 Sep 2022 18:08:40 -0400 Subject: [PATCH] Fix android compilation: missing cast when formatting value in string (#22382) * Fix android compilation: missing cast when formatting value in string * Restyle --- examples/tv-app/android/java/AppPlatformShellCommands-JNI.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/tv-app/android/java/AppPlatformShellCommands-JNI.cpp b/examples/tv-app/android/java/AppPlatformShellCommands-JNI.cpp index 4a00a3663d62ec..ac54746b0aa8e8 100644 --- a/examples/tv-app/android/java/AppPlatformShellCommands-JNI.cpp +++ b/examples/tv-app/android/java/AppPlatformShellCommands-JNI.cpp @@ -48,7 +48,7 @@ static CHIP_ERROR pairApp(bool printHeader, size_t index) if (printHeader) { char str[64]; - sprintf(str, "udc-commission %ld\r\n", (long) index); + sprintf(str, "udc-commission %ld\r\n", static_cast(index)); strcat(response, str); } @@ -57,7 +57,7 @@ static CHIP_ERROR pairApp(bool printHeader, size_t index) if (state == nullptr) { char str[64]; - sprintf(str, "udc client[%d] null \r\n", index); + sprintf(str, "udc client[%ld] null \r\n", static_cast(index)); strcat(response, str); } else