Skip to content

Commit

Permalink
tests: Make sure we get the requested number of bytes from /dev/urandom
Browse files Browse the repository at this point in the history
  • Loading branch information
practicalswift committed Jan 12, 2018
1 parent c95f6f1 commit 82a96e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 82a96e4

Please sign in to comment.