summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarijn Suijten <marijns95@gmail.com>2022-08-02 12:21:22 +0200
committerTanu Kaskinen <tanuk@iki.fi>2022-08-16 08:16:24 +0300
commit518ca03019f9c7cfd361b57673e9e6c3c1787579 (patch)
tree2009ddd3fc910b809d77fe84da819ac85b391920
parent6ec084e2b3d941c5fb098ddbd83e734be7a500c3 (diff)
downloadpulseaudio-518ca03019f9c7cfd361b57673e9e6c3c1787579.tar.gz
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>
-rw-r--r--src/modules/bluetooth/backend-native.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/modules/bluetooth/backend-native.c b/src/modules/bluetooth/backend-native.c
index f94a8eeb4..1e366acf8 100644
--- a/src/modules/bluetooth/backend-native.c
+++ b/src/modules/bluetooth/backend-native.c
@@ -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;