commit 5d9ad87c1564e1e8837f732d35d54c0381f82451 parent cfe2b19f3de1c594045f225f7628aeec19c5e062 Author: Michael Savage <mikejsavage@gmail.com> Date: Mon, 5 May 2014 14:29:35 +0100 Fix char device check in open_random Diffstat:
src/main.c | | | 2 | +- |
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main.c b/src/main.c @@ -60,7 +60,7 @@ static int open_random( const char * const path ) { } // is this a random device? - if( S_ISCHR( stat_buf.st_mode ) != 0 && stat_buf.st_rdev != makedev( 1, 8 ) && stat_buf.st_rdev != makedev( 1, 9 ) ) { + if( S_ISCHR( stat_buf.st_mode ) == 0 || ( stat_buf.st_rdev != makedev( 1, 8 ) && stat_buf.st_rdev != makedev( 1, 9 ) ) ) { ( void ) fclose( f ); return BC_ERR_RNG;