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
…project-chip#22382)

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

* Restyle
  • Loading branch information
andy31415 authored Sep 2, 2022
1 parent c33f59c commit 9c2f087
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 9c2f087

Please sign in to comment.