From 1a8900e7ed232f1c99cc903032806d8b250f7085 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 18 Feb 2021 16:18:51 +0100 Subject: [PATCH] random-util: fix type of random_u64_range() As the name of the function suggests this is supposed to return uint64_t, of course. Fix it. Not sure how this mistake happened in the first place... --- src/basic/random-util.c | 2 +- src/basic/random-util.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/basic/random-util.c b/src/basic/random-util.c index eca8187571..a125e5228e 100644 --- a/src/basic/random-util.c +++ b/src/basic/random-util.c @@ -495,7 +495,7 @@ int random_write_entropy(int fd, const void *seed, size_t size, bool credit) { return 1; } -int random_u64_range(uint64_t m) { +uint64_t random_u64_range(uint64_t m) { uint64_t x, remainder; /* Generates a random number in the range 0…m-1, unbiased. (Java's algorithm) */ diff --git a/src/basic/random-util.h b/src/basic/random-util.h index 1d5fb60fa2..e6528ddc7f 100644 --- a/src/basic/random-util.h +++ b/src/basic/random-util.h @@ -41,4 +41,4 @@ size_t random_pool_size(void); int random_write_entropy(int fd, const void *seed, size_t size, bool credit); -int random_u64_range(uint64_t max); +uint64_t random_u64_range(uint64_t max);