win32/rand.cpp: Add missing static_cast

As opposed to C, C++ does not allow casting from void * to other pointer
types.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9542 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 4b30d393f723ce5ab551d93249d72a32feeab090
Former-commit-id: da5c06d9a2f96c81bec46ead1e56a24b3e6732fb
This commit is contained in:
xavi92 2024-08-15 00:12:25 +00:00
parent 42da74eba0
commit 707bd2e28b

View file

@ -38,7 +38,7 @@ int portability::rand(void *buf, size_t n)
fprintf(stderr, "ensure failed\n");
return -1;
}
else if (!CryptGenRandom(prov, n, buf))
else if (!CryptGenRandom(prov, n, static_cast<BYTE *>(buf)))
{
fprintf(stderr, "CryptGenRandom failed with %#x\n", GetLastError());
goto end;