diff --git a/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.h b/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.h index 3f33b69e526c0e..bfa048e8984651 100644 --- a/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.h +++ b/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.h @@ -40,7 +40,8 @@ using ConnectCallback = std::function; using DisconnectCallback = std::function; const int kPortMaxLength = 5; // port is uint16_t -const int kIdMaxLength = chip::Dnssd::kHostNameMaxLength + kPortMaxLength; +// +1 for the : between the hostname and the port. +const int kIdMaxLength = chip::Dnssd::kHostNameMaxLength + kPortMaxLength + 1; class CastingPlayerAttributes {