[PATCH] lib/uuid.c: use correct offset in uuid parser

From: =3D?UTF-8?q?Bj=3DC3=3DB8rn=3D20Mork?=3D
Date: Mon May 30 2016 - 06:44:05 EST


Use '+ 0' and '+ 1' as offsets, like they were intended, instead
of adding to the result.

Fixes: 2b1b0d66704a ("lib/uuid.c: introduce a few more generic helpers")
Signed-off-by: Bj=C3=B8rn Mork <bjorn@xxxxxxx>
---
lib/uuid.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/uuid.c b/lib/uuid.c
index e116ae5fa00f..37687af77ff8 100644
--- a/lib/uuid.c
+++ b/lib/uuid.c
@@ -106,8 +106,8 @@ static int __uuid_to_bin(const char *uuid, __u8 b[16], =
const u8 ei[16])
return -EINVAL;
=20
for (i =3D 0; i < 16; i++) {
- int hi =3D hex_to_bin(uuid[si[i]] + 0);
- int lo =3D hex_to_bin(uuid[si[i]] + 1);
+ int hi =3D hex_to_bin(uuid[si[i] + 0]);
+ int lo =3D hex_to_bin(uuid[si[i] + 1]);
=20
b[ei[i]] =3D (hi << 4) | lo;
}
--=20
2.1.4


--=-=-=--