* (bug 3019) use the operating system's random number generator if possible
when generating the qkey file
This commit is contained in:
parent
8801b06a1e
commit
c6249fcc25
7 changed files with 65 additions and 9 deletions
|
@ -174,6 +174,22 @@ char *strlwr (char *s) {
|
|||
return s; // bk001204 - duh
|
||||
}
|
||||
|
||||
qboolean Sys_RandomBytes( byte *string, int len )
|
||||
{
|
||||
FILE *fp;
|
||||
|
||||
fp = fopen( "/dev/urandom", "r" );
|
||||
if( !fp )
|
||||
return qfalse;
|
||||
|
||||
if( !fread( string, sizeof( byte ), len, fp ) ) {
|
||||
fclose( fp );
|
||||
return qfalse;
|
||||
}
|
||||
fclose( fp );
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
//============================================
|
||||
|
||||
#define MAX_FOUND_FILES 0x1000
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue