1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-19 13:03:11 +01:00

Implement util_rand due to rand having a poor range on some platforms

This commit is contained in:
duncanspumpkin
2015-11-20 19:41:27 +00:00
parent 5ef10f5050
commit 5bd3b8d6af
14 changed files with 73 additions and 43 deletions

View File

@@ -832,7 +832,7 @@ std::string Network::GenerateAdvertiseKey()
static char hexChars[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
char key[17];
for (int i = 0; i < 16; i++) {
int hexCharIndex = rand() % countof(hexChars);
int hexCharIndex = util_rand() % countof(hexChars);
key[i] = hexChars[hexCharIndex];
}
key[countof(key) - 1] = 0;