improve win32 random
This commit is contained in:
+8
-1
@@ -558,7 +558,14 @@ void APP_CC
|
|||||||
g_random(char* data, int len)
|
g_random(char* data, int len)
|
||||||
{
|
{
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
memset(data, 0x44, len);
|
int index;
|
||||||
|
|
||||||
|
srand(g_time1());
|
||||||
|
for (index = 0; index < len; index++)
|
||||||
|
{
|
||||||
|
data[index] = (char)rand(); /* rand returns a number between 0 and
|
||||||
|
RAND_MAX */
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user