Skip to content
Snippets Groups Projects
Verified Commit fd34f33a authored by Vladimír Čunát's avatar Vladimír Čunát
Browse files

lib/utils kr_rand_bytes(): minor issue on 32-bit systems

Really support 64-bit return value even there.
Currently we only use such large value in an unimportant case
(lua_Number seed).
parent 1dc3666e
Branches
Tags
1 merge request!1167various undefined-behavior fixes
Pipeline #79548 failed with stages
in 41 minutes and 15 seconds
......@@ -201,7 +201,7 @@ static inline uint64_t kr_rand_bytes(unsigned int size)
* Alternatively we could waste more rnd bytes, but that seemed worse. */
result = 0;
for (unsigned int i = 0; i < size; ++ i) {
result |= ((size_t)data[i]) << (i * 8);
result |= ((uint64_t)data[i]) << (i * 8);
}
return result;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment