From 82a96e45870d18afa323bb5f73251e195e34a2ce Mon Sep 17 00:00:00 2001 From: practicalswift Date: Fri, 12 Jan 2018 11:23:28 +0100 Subject: [PATCH] tests: Make sure we get the requested number of bytes from /dev/urandom --- src/tests.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests.c b/src/tests.c index 580eea7..f6255bf 100644 --- a/src/tests.c +++ b/src/tests.c @@ -4913,7 +4913,7 @@ int main(int argc, char **argv) { } } else { FILE *frand = fopen("/dev/urandom", "r"); - if ((frand == NULL) || !fread(&seed16, sizeof(seed16), 1, frand)) { + if ((frand == NULL) || fread(&seed16, sizeof(seed16), 1, frand) != sizeof(seed16)) { uint64_t t = time(NULL) * (uint64_t)1337; seed16[0] ^= t; seed16[1] ^= t >> 8;