From 05050eba3832ae3b70b8d4fe223084cd38101221 Mon Sep 17 00:00:00 2001 From: cpq Date: Mon, 22 Mar 2021 11:29:59 +0000 Subject: [PATCH] Squash warning in mg_random --- src/util.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/util.c b/src/util.c index 61c9e087..d6e0f776 100644 --- a/src/util.c +++ b/src/util.c @@ -91,9 +91,8 @@ void mg_random(void *buf, size_t len) { #if MG_ENABLE_FS FILE *fp = mg_fopen("/dev/urandom", "rb"); if (fp != NULL) { - fread(buf, 1, len, fp); + if (fread(buf, 1, len, fp) == len) done = true; fclose(fp); - done = true; } #endif if (!done) {