Browse Source

Utility: Fixed bug in `rand_string`

pull/886/head
Valentin Radu 4 years ago
parent
commit
d5b63319f0
  1. 2
      ExplorerPatcher/utility.h

2
ExplorerPatcher/utility.h

@ -268,7 +268,7 @@ static inline WCHAR* rand_string(WCHAR* str, size_t size)
if (size) { if (size) {
--size; --size;
for (size_t n = 0; n < size; n++) { 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[n] = charset[key];
} }
str[size] = L'\0'; str[size] = L'\0';

Loading…
Cancel
Save