Merge pull request #153 from dionrhys/read-urandom-unbuffered

Ensure reads from /dev/urandom are unbuffered
This commit is contained in:
Tim Angus 2015-09-07 13:00:23 +01:00
commit ed845a57c6

View file

@ -123,6 +123,8 @@ qboolean Sys_RandomBytes( byte *string, int len )
if( !fp )
return qfalse;
setvbuf( fp, NULL, _IONBF, 0 ); // don't buffer reads from /dev/urandom
if( fread( string, sizeof( byte ), len, fp ) != len )
{
fclose( fp );