mirror of
https://github.com/valinet/ExplorerPatcher.git
synced 2024-11-15 03:27:35 +01:00
Utility: Fixed bug in rand_string
This commit is contained in:
parent
c00de82cd6
commit
d5b63319f0
@ -268,7 +268,7 @@ static inline WCHAR* rand_string(WCHAR* str, size_t size)
|
||||
if (size) {
|
||||
--size;
|
||||
for (size_t n = 0; n < size; n++) {
|
||||
int key = rand() % (int)(sizeof charset - 1);
|
||||
int key = rand() % (int)((sizeof(charset) / sizeof(WCHAR)) - 1);
|
||||
str[n] = charset[key];
|
||||
}
|
||||
str[size] = L'\0';
|
||||
|
Loading…
Reference in New Issue
Block a user