tests: Make sure we get the requested number of bytes from /dev/urandom

This commit is contained in:
practicalswift 2018-01-12 11:23:28 +01:00
parent c95f6f1360
commit 82a96e4587
1 changed files with 1 additions and 1 deletions

View File

@ -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;