From 15c77acfb4326b7c39f3d2d48f13fbd9fe30404e Mon Sep 17 00:00:00 2001 From: Jonathan Rico Date: Mon, 13 Mar 2023 12:18:52 +0100 Subject: [PATCH] tests: Bluetooth: fix att_mtu warnings on gcc-12 The warnings are correct, we were copying 17 bytes from a 4-byte source. Signed-off-by: Jonathan Rico --- .../bluetooth/mtu_update/central/src/central_mtu_update.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/samples/bluetooth/mtu_update/central/src/central_mtu_update.c b/samples/bluetooth/mtu_update/central/src/central_mtu_update.c index f969b517752..046446882dc 100644 --- a/samples/bluetooth/mtu_update/central/src/central_mtu_update.c +++ b/samples/bluetooth/mtu_update/central/src/central_mtu_update.c @@ -34,6 +34,8 @@ static void start_scan(void); static struct bt_conn *default_conn; static struct bt_uuid_128 uuid = BT_UUID_INIT_128(0); +static const struct bt_uuid *ccc_uuid = BT_UUID_GATT_CCC; + static struct bt_gatt_discover_params discover_params; static struct bt_gatt_subscribe_params subscribe_params; @@ -82,8 +84,7 @@ static uint8_t discover_func(struct bt_conn *conn, const struct bt_gatt_attr *at printk("Discover failed (err %d)\n", err); } } else if (!bt_uuid_cmp(discover_params.uuid, BT_UUID_MTU_TEST_NOTIFY)) { - memcpy(&uuid, BT_UUID_GATT_CCC, sizeof(uuid)); - discover_params.uuid = &uuid.uuid; + discover_params.uuid = ccc_uuid; discover_params.start_handle = attr->handle + 2; discover_params.type = BT_GATT_DISCOVER_DESCRIPTOR; subscribe_params.value_handle = bt_gatt_attr_value_handle(attr);