samples: Bluetooth: Fix TMAP peripheral off-by-one URI schemes

i has to be less than the size of the array, as we use i as the
index.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
Emil Gydesen 2023-06-20 11:17:28 +02:00 committed by Carles Cufí
commit ca1fd03520

View file

@ -100,7 +100,7 @@ static void read_uri_schemes_string_cb(struct bt_conn *conn, int err,
} }
} }
if (i > sizeof(remote_uri)) { if (i >= sizeof(remote_uri)) {
printk("Cannot store URI of length %zu: %s\n", i, value); printk("Cannot store URI of length %zu: %s\n", i, value);
return; return;
} }