Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d7dc7083 authored by Nick Desaulniers's avatar Nick Desaulniers
Browse files

[system][bt] fix -Wdangling-gsl



BtAddrString() returns a std::string. It's not safe to chain a call to
c_str() as otherwise the returned std::string is a temporary, and the
expression evaluates to an immediately dangling pointer.

Bug: 139945549
Test: mm
Change-Id: I30972458abcc563b24ee0d80b289c3efd6c3e04d
Signed-off-by: default avatarNick Desaulniers <ndesaulniers@google.com>
parent c88bac3a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -188,8 +188,8 @@ void LowEnergyClient::MtuChangedCallback(

  if (!bda) return;

  const char* addr = BtAddrString(bda).c_str();
  if (delegate_) delegate_->OnMtuChanged(this, status, addr, mtu);
  std::string addr = BtAddrString(bda);
  if (delegate_) delegate_->OnMtuChanged(this, status, addr.c_str(), mtu);
}

// LowEnergyClientFactory implementation