1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-09-20 05:44:56 +03:00

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...
This commit is contained in:
Lennart Poettering
2021-02-18 16:18:51 +01:00
parent e55daa2599
commit 1a8900e7ed
2 changed files with 2 additions and 2 deletions

View File

@@ -495,7 +495,7 @@ int random_write_entropy(int fd, const void *seed, size_t size, bool credit) {
return 1; return 1;
} }
int random_u64_range(uint64_t m) { uint64_t random_u64_range(uint64_t m) {
uint64_t x, remainder; uint64_t x, remainder;
/* Generates a random number in the range 0…m-1, unbiased. (Java's algorithm) */ /* Generates a random number in the range 0…m-1, unbiased. (Java's algorithm) */

View File

@@ -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_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);