mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-22 20:58:22 +00:00
lib: uuid: fix uuid_str_to_bin() on 32-bit
hextoul() cannot convert a string to a 64-bit number on a 32-bit system.
Use function hextoull() instead.
Reported-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Fixes: 22c48a92cd
("lib: uuid: supporting building as part of host tools")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
This commit is contained in:
parent
e5a0cb3eb3
commit
6a2664b126
1 changed files with 1 additions and 1 deletions
|
@ -313,7 +313,7 @@ int uuid_str_to_bin(const char *uuid_str, unsigned char *uuid_bin,
|
||||||
tmp16 = cpu_to_be16(hextoul(uuid_str + 19, NULL));
|
tmp16 = cpu_to_be16(hextoul(uuid_str + 19, NULL));
|
||||||
memcpy(uuid_bin + 8, &tmp16, 2);
|
memcpy(uuid_bin + 8, &tmp16, 2);
|
||||||
|
|
||||||
tmp64 = cpu_to_be64(hextoul(uuid_str + 24, NULL));
|
tmp64 = cpu_to_be64(hextoull(uuid_str + 24, NULL));
|
||||||
memcpy(uuid_bin + 10, (char *)&tmp64 + 2, 6);
|
memcpy(uuid_bin + 10, (char *)&tmp64 + 2, 6);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue