Skip to content

Commit

Permalink
Fix android compilation: missing cast when formatting value in string (
Browse files Browse the repository at this point in the history
…#22382)

* Fix android compilation: missing cast when formatting value in string

* Restyle
  • Loading branch information
andy31415 authored and pull[bot] committed Jul 6, 2023
1 parent bb0bfeb commit 2361988
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/tv-app/android/java/AppPlatformShellCommands-JNI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<long>(index));
strcat(response, str);
}

Expand All @@ -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<long>(index));
strcat(response, str);
}
else
Expand Down

0 comments on commit 2361988

Please sign in to comment.