From 9c0c8fe0beddf7455d5f641835fe350b95dfec96 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Thu, 26 Sep 2019 17:03:46 +0100 Subject: [PATCH] rand/noise.c: Fix foolish bug in the `getentropy' code. I've probably never built this before. :-/ --- rand/noise.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rand/noise.c b/rand/noise.c index 280c49cb..c120e6f2 100644 --- a/rand/noise.c +++ b/rand/noise.c @@ -217,7 +217,7 @@ int noise_devrandom(rand_pool *r) /* --- OpenBSD-flavoured shinies --- */ while (n < sizeof(buf)) { - nn = sizeof(buf) - nn; + nn = sizeof(buf) - n; if (nn > 256) nn = 256; if (getentropy(buf + n, nn)) break; n += nn; -- 2.11.0