From: Rudolf Polzer Date: Sat, 24 Apr 2010 19:58:11 +0000 (+0200) Subject: don't read so much from /dev/random as it's slow X-Git-Tag: xonotic-v0.1.0preview~50 X-Git-Url: https://git.xonotic.org/?a=commitdiff_plain;h=698fe0ac106c840671df6668946135e7c8ef4963;p=xonotic%2Fd0_blind_id.git don't read so much from /dev/random as it's slow --- diff --git a/d0_bignum-gmp.c b/d0_bignum-gmp.c index 87aa0b8..a66096d 100644 --- a/d0_bignum-gmp.c +++ b/d0_bignum-gmp.c @@ -41,6 +41,7 @@ void d0_bignum_INITIALIZE() if(f) { unsigned char buf[256]; + setbuf(f, NULL); if(fread(buf, sizeof(buf), 1, f) == 1) { mpz_import(temp.z, sizeof(buf), 1, 1, 0, 0, buf);