diff options
| author | Maciej Żenczykowski <maze@google.com> | 2021-11-18 10:50:36 -0800 |
|---|---|---|
| committer | Maciej Żenczykowski <maze@google.com> | 2021-11-18 12:59:38 -0800 |
| commit | f4f22b22d2bf40380ff75c3f2e75e70e6bcc27bf (patch) | |
| tree | 2ae5e4df978ac16f0f82964e55dee0e620182fa3 /server/TetherController.cpp | |
| parent | 5edb1b68d00a04d33f6e8641906996198ffec8ef (diff) | |
use str.empty() to check for empty string instead of !str[0]
!str[0] is technically speaking reaching past the end of the 0-byte empty string,
though there should normally be an extra 0 byte added to facilitate .c_str()
Bug: 206703697
Test: TreeHugger, atest netd_unit_test
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I88ddae1b00ff020bd833d057468f729fb530216d
Diffstat (limited to 'server/TetherController.cpp')
| -rw-r--r-- | server/TetherController.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/server/TetherController.cpp b/server/TetherController.cpp index d8a690f9..d21c9a48 100644 --- a/server/TetherController.cpp +++ b/server/TetherController.cpp @@ -879,7 +879,7 @@ int TetherController::addForwardChainStats(TetherStatsList& statsList, * which is what TetherController sets up. * The 1st matches rx, and sets up the pair for the tx side. */ - if (!stats.intIface[0]) { + if (stats.intIface.empty()) { ALOGV("0Filter RX iface_in=%s iface_out=%s rx_bytes=%" PRId64 " rx_packets=%" PRId64 " ", iface0.c_str(), iface1.c_str(), bytes, packets); stats.intIface = iface0; |
