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

Commit eadcbba0 authored by George Burgess IV's avatar George Burgess IV
Browse files

hf_client: explicitly zero-initialize a variable

This variable is potentially used without being initialized on line
1335. While our compiler currently zero-initializes all stack variables,
this isn't guaranteed to be the case in the future, so make this
explicit.

Caught by the static analyzer:
packages/modules/Bluetooth/system/bta/hf_client/bta_hf_client_at.cc:1335:5:
warning: 8th function call argument is an uninitialized value
[clang-analyzer-core.CallAndMessage]

Tag: #stability
Bug: 206470603
Test: TreeHugger
Change-Id: I5238ddc176c9256782aa4a2150f94e6bd27e6212
parent bff45ba1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1279,7 +1279,7 @@ static char* bta_hf_client_parse_clcc(tBTA_HF_CLIENT_CB* client_cb,
                                      char* buffer) {
  uint16_t idx, dir, status, mode, mpty;
  char numstr[33]; /* spec forces 32 chars, plus one for \0*/
  uint16_t type;
  uint16_t type = 0;
  int res;
  int offset = 0;