Bluetooth: Audio: Media - search to not modify parameter

Update the search parser to not modify the supplied parameter.
This will allow the parameter to be made 'const'.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
This commit is contained in:
Asbjørn Sæbø 2022-04-06 15:31:18 +02:00 committed by Johan Hedberg
commit ebaad4501c

View file

@ -2614,9 +2614,9 @@ static void parse_search(struct mpl_search search)
bool search_failed = false;
if (search.len > SEARCH_LEN_MAX) {
BT_WARN("Search too long (%d) - truncating", search.len);
search.len = SEARCH_LEN_MAX;
}
BT_WARN("Search too long (%d) - aborting", search.len);
search_failed = true;
} else {
BT_DBG("Parsing %d octets search", search.len);
while (search.len - index > 0) {
@ -2644,6 +2644,7 @@ static void parse_search(struct mpl_search search)
BT_HEXDUMP_DBG(sci.param, sci.len-1, "param:");
sci_num++;
}
}
/* TODO: Add real search functionality. */
/* For now, just fake it. */