lib/uuid: Fix bt_uuid_strcmp
Subsystems (3)
Luiz Augusto von Dentz
maintainerPATCH 1/1 lib/uuid: Fix bt_uuid_strcmp
From: Luiz Augusto von Dentz <[email protected]>
bt_uuid_strcmp shall first convert the strings to bt_uuid_t using bt_string_to_uuid since bt_uuid_to_string can produce different formats depending on the type.
--- lib/uuid.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
lib/uuid.c +6 -1
@@ -289,7 +289,12 @@ int bt_string_to_uuid(bt_uuid_t *uuid, const char *string)int bt_uuid_strcmp (const void *a,const void *b) { -return strcasecmp (a, b); +bt_uuid_t u1, u2; + +bt_string_to_uuid (&u1, a); +bt_string_to_uuid (&u2, b); + +return bt_uuid_cmp (&u1, &u2); }int bt_uuid_to_le (const bt_uuid_t *src,void *dst)
Signature · 1 line
2.4.3
Hi,
Quoted 28 lines · Luiz Augusto von Dentz
From: Luiz Augusto von Dentz <[email protected]>
bt_uuid_strcmpshall first convert the strings tobt_uuid_tusingbt_string_to_uuidsincebt_uuid_to_stringcan produce different formats depending on the type.--- lib/uuid.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)lib/uuid.c +6
-2@@ -289,7 +289,12 @@ int bt_string_to_uuid(bt_uuid_t *uuid, const char *string)int bt_uuid_strcmp (const void *a,const void *b) { -return strcasecmp (a, b); +bt_uuid_t u1, u2; + +bt_string_to_uuid (&u1, a); +bt_string_to_uuid (&u2, b); + +return bt_uuid_cmp (&u1, &u2); }int bt_uuid_to_le (const bt_uuid_t *src,void *dst) --
Quoted 1 line
2.4.3
Applied.
Signature · 1 line
Luiz Augusto von Dentz