Correct test of FILE value. Get rid of compiler warning.

This commit is contained in:
Petter Reinholdtsen 2013-10-13 22:19:18 +02:00
parent 051bcd77bc
commit 8cdeda51f4

View File

@ -69,7 +69,7 @@ srandomdev(void)
#ifndef WIN32 #ifndef WIN32
FILE *fd; FILE *fd;
fd = fopen("/dev/urandom", "r"); fd = fopen("/dev/urandom", "r");
if (fd >= 0) { if (NULL != fd) {
if (fread(&seed, sizeof seed, 1, fd) != 1) if (fread(&seed, sizeof seed, 1, fd) != 1)
WARNF("fread(\"/dev/urandom\") failed -- falling back to gettimeofday()"); WARNF("fread(\"/dev/urandom\") failed -- falling back to gettimeofday()");
else else