Skip to content

Commit b6fb328

Browse files
alexsvenrlubos
authored andcommitted
applications: nrf5340_audio: memcmp in scan_for_conn
- Use memcmp instead of strncmp in scan_for_conn - Helps if there is no '\0' in the device name - OCT-3155 Signed-off-by: Alexander Svensen <[email protected]>
1 parent 50ed586 commit b6fb328

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

applications/nrf5340_audio/src/bluetooth/bt_management/scanning/bt_mgmt_scan_for_conn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static bool device_name_check(struct bt_data *data, void *user_data)
144144
if (data->type == BT_DATA_NAME_COMPLETE || data->type == BT_DATA_NAME_SHORTENED) {
145145
size_t srch_name_size = strlen(srch_name);
146146
if ((data->data_len == srch_name_size) &&
147-
(strncmp(srch_name, data->data, srch_name_size) == 0)) {
147+
(memcmp(srch_name, data->data, srch_name_size) == 0)) {
148148
/* Check if the device is still connected due to waiting for ACL timeout */
149149
if (conn_exist_check(addr)) {
150150
/* Device is already connected, stop parsing the adv data */

0 commit comments

Comments
 (0)