From: Lennart Poettering Date: Thu, 18 Feb 2021 15:18:51 +0000 (+0100) Subject: random-util: fix type of random_u64_range() X-Git-Tag: v248-rc1~53 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1a8900e7ed232f1c99cc903032806d8b250f7085;p=thirdparty%2Fsystemd.git 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... --- diff --git a/src/basic/random-util.c b/src/basic/random-util.c index eca81875717..a125e5228e7 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 1d5fb60fa24..e6528ddc7fe 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);