backend-native: Update all CIND indicators

When `indicator` is initialized to `1`:
- it always succeeds the `indicator == CIND_CALL_INDICATOR` check;
- hence always calls `continue`;
- hence never reaches the end of the `while` loop where `indicator++` is
  called;
- hence `indicator` never contains any other value than `1` meaning
  `cind_enabled_indicators` is ever updated.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/740>
This commit is contained in:
Marijn Suijten 2022-08-02 12:21:22 +02:00 committed by Tanu Kaskinen
parent 6ec084e2b3
commit 518ca03019

View file

@ -637,9 +637,8 @@ static bool hfp_rfcomm_handle(int fd, pa_bluetooth_transport *t, const char *buf
return true;
} else if (sscanf(buf, "AT+BIA=%s", str) == 1) {
/* Indicators start with index 1 and follow the order of the AT+CIND=? response */
indicator = 1;
while ((r = pa_split_in_place(str, ",", &len, &state))) {
for (indicator = 1; (r = pa_split_in_place(str, ",", &len, &state)); indicator++) {
/* Ignore updates to mandatory indicators which are always ON */
if (indicator == CIND_CALL_INDICATOR
|| indicator == CIND_CALL_SETUP_INDICATOR
@ -659,8 +658,6 @@ static bool hfp_rfcomm_handle(int fd, pa_bluetooth_transport *t, const char *buf
rfcomm_write_response(fd, "ERROR");
return false;
}
indicator++;
}
return true;