Skip to content

Commit 3d3f65f

Browse files
committed
Reverse UUID conversion loop
1 parent 4dfc0a4 commit 3d3f65f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

libraries/CurieBle/src/BleUuid.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@
2222
BleUuid::BleUuid(const char * str)
2323
{
2424
char temp[] = {0, 0, 0};
25-
int strLenth = strlen(str);
25+
int strLength = strlen(str);
2626
int length = 0;
2727

28-
for (int i = 0; i < strLenth && length < MAX_UUID_SIZE; i +=2) {
28+
memset(&_uuid, 0x00, sizeof(_uuid));
29+
30+
for (int i = strLength - 1; i >= 0 && length < MAX_UUID_SIZE; i -= 2) {
2931
if (str[i] == '-') {
30-
i--;
32+
i++;
3133
continue;
3234
}
3335

0 commit comments

Comments
 (0)