diff options
-rw-r--r-- | attrib/gatt.c | 2 | ||||
-rw-r--r-- | lib/uuid.c | 2 | ||||
-rw-r--r-- | src/attrib-server.c | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/attrib/gatt.c b/attrib/gatt.c index 77c96f377..a62f348c6 100644 --- a/attrib/gatt.c +++ b/attrib/gatt.c @@ -241,7 +241,7 @@ guint gatt_discover_primary(GAttrib *attrib, bt_uuid_t *uuid, gatt_cb_t func, dp->user_data = user_data; if (uuid) { - memcpy(&dp->uuid, uuid, sizeof(bt_uuid_t)); + dp->uuid = *uuid; cb = primary_by_uuid_cb; } else cb = primary_all_cb; diff --git a/lib/uuid.c b/lib/uuid.c index 325016aab..a3e2a1ad8 100644 --- a/lib/uuid.c +++ b/lib/uuid.c @@ -74,7 +74,7 @@ void bt_uuid_to_uuid128(const bt_uuid_t *src, bt_uuid_t *dst) { switch (src->type) { case BT_UUID128: - memcpy(dst, src, sizeof(bt_uuid_t)); + *dst = *src; break; case BT_UUID32: bt_uuid32_to_uuid128(src, dst); diff --git a/src/attrib-server.c b/src/attrib-server.c index 2e99a529f..59dddf6f2 100644 --- a/src/attrib-server.c +++ b/src/attrib-server.c @@ -1255,7 +1255,7 @@ struct attribute *attrib_db_add(uint16_t handle, bt_uuid_t *uuid, int read_reqs, a->len = len; a->data = g_memdup(value, len); a->handle = handle; - memcpy(&a->uuid, uuid, sizeof(bt_uuid_t)); + a->uuid = *uuid; a->read_reqs = read_reqs; a->write_reqs = write_reqs; @@ -1287,7 +1287,7 @@ int attrib_db_update(uint16_t handle, bt_uuid_t *uuid, const uint8_t *value, memcpy(a->data, value, len); if (uuid != NULL) - memcpy(&a->uuid, uuid, sizeof(bt_uuid_t)); + a->uuid = *uuid; if (attr) *attr = a; |