diff --git a/ExplorerPatcher/utility.h b/ExplorerPatcher/utility.h index a8bcdec..77203d6 100644 --- a/ExplorerPatcher/utility.h +++ b/ExplorerPatcher/utility.h @@ -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';