aboutsummaryrefslogtreecommitdiffstats
path: root/code/qcommon
diff options
context:
space:
mode:
Diffstat (limited to 'code/qcommon')
-rw-r--r--code/qcommon/common.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/code/qcommon/common.c b/code/qcommon/common.c
index 0f28072..fb9f664 100644
--- a/code/qcommon/common.c
+++ b/code/qcommon/common.c
@@ -2499,7 +2499,6 @@ static void Com_DetectAltivec(void)
}
}
-
/*
=================
Com_InitRand
@@ -2509,8 +2508,8 @@ Seed the random number generator, if possible with an OS supplied random seed.
static void Com_InitRand(void)
{
unsigned int seed;
-
- if(Sys_Random(&seed, sizeof(seed)))
+
+ if(Sys_RandomBytes(&seed, sizeof(seed)))
srand(seed);
else
srand(time(NULL));
@@ -3341,7 +3340,8 @@ void Com_RandomBytes( byte *string, int len )
return;
Com_Printf( "Com_RandomBytes: using weak randomization\n" );
+ srand( time( 0 ) );
for( i = 0; i < len; i++ )
- string[i] = (unsigned char)( random() % 255 );
+ string[i] = (unsigned char)( rand() % 255 );
}