From 9e4ea641bbf2251f36ac725778c0401b6c6daf9d Mon Sep 17 00:00:00 2001 From: pons Date: Tue, 14 May 2019 09:27:54 +0200 Subject: [PATCH] Revert --- Timer.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Timer.cpp b/Timer.cpp index 89d5280..41b3479 100644 --- a/Timer.cpp +++ b/Timer.cpp @@ -110,16 +110,14 @@ std::string Timer::getSeed(int size) { #else - FILE *f = fopen("/dev/random","rb"); + FILE *f = fopen("/dev/urandom","rb"); if(f==NULL) { - printf("Failed to open /dev/random %s\n", strerror( errno )); + printf("Failed to open /dev/urandom %s\n", strerror( errno )); exit(1); } - for (int i = 0; i < size; i++) { - if( fread(buff+i,1,1,f)!=1 ) { - printf("Failed to read from /dev/random %s\n", strerror( errno )); - exit(1); - } + if( fread(buff,1,size,f)!=size ) { + printf("Failed to read from /dev/urandom %s\n", strerror( errno )); + exit(1); } fclose(f);