Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0c08346

Browse files
committed
Fix compiler warning in win32_urandom(): explicit cast to DWORD in
CryptGenRandom()
1 parent f558778 commit 0c08346

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Python/random.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ win32_urandom(unsigned char *buffer, Py_ssize_t size, int raise)
5050
while (size > 0)
5151
{
5252
chunk = size > INT_MAX ? INT_MAX : size;
53-
if (!CryptGenRandom(hCryptProv, chunk, buffer))
53+
if (!CryptGenRandom(hCryptProv, (DWORD)chunk, buffer))
5454
{
5555
/* CryptGenRandom() failed */
5656
if (raise)

0 commit comments

Comments
 (0)