From 9dbe35a4dd8d5fce96c627f000d15395f32bc55a Mon Sep 17 00:00:00 2001 From: tjw Date: Fri, 16 Feb 2007 23:50:37 +0000 Subject: * (bug 3019) use the operating system's random number generator if possible when generating the qkey file git-svn-id: svn://svn.icculus.org/quake3/trunk@1046 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/client/cl_main.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'code/client') diff --git a/code/client/cl_main.c b/code/client/cl_main.c index bb8d635..cfb1313 100644 --- a/code/client/cl_main.c +++ b/code/client/cl_main.c @@ -2534,18 +2534,14 @@ static void CL_GenerateQKey(void) return; } else { - int i; - if( len > 0 ) { Com_Printf( "QKEY file size != %d, regenerating\n", QKEY_SIZE ); } - srand(time(0)); - for(i = 0; i < sizeof(buff) - 1; i++) { - buff[i] = (unsigned char)(rand() % 255); - } - buff[i] = 0; + Com_Printf( "QKEY building random string\n" ); + Com_RandomBytes( buff, sizeof(buff) ); + f = FS_SV_FOpenFileWrite( QKEY_FILE ); if( !f ) { Com_Printf( "QKEY could not open %s for write\n", -- cgit v1.2.3