From 5e36d4e8ed8821fe4cb8ee6849ce991aac49a23e Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 30 Mar 2015 16:46:36 +0300 Subject: [PATCH] lib/uuid: Fix bt_uuid_to_le bt_uuid_to_le is currently broken if the src uuid is type 32 bits since it does the conversion to 128 bits but still uses the original value to swap instead of the coverted one. --- lib/uuid.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/uuid.c b/lib/uuid.c index 4f34b17f4..fd6196806 100644 --- a/lib/uuid.c +++ b/lib/uuid.c @@ -301,7 +301,8 @@ int bt_uuid_to_le(const bt_uuid_t *src, void *dst) bt_put_le16(src->value.u16, dst); return 0; case BT_UUID32: - bt_uuid_to_uuid128(src, &uuid); + bt_uuid32_to_uuid128(src, &uuid); + src = &uuid; /* Fallthrough */ case BT_UUID128: /* Convert from 128-bit BE to LE */ -- 2.47.3