rcx

miscellaneous C library
git clone git://git.rr3.xyz/rcx
Log | Files | Refs | README | LICENSE

commit ae1cedbd986cc171d082577490ad38bf6fc04f11
parent d48cb3c6cee655dbc28a4285b8b4b1377249555c
Author: Robert Russell <robert@rr3.xyz>
Date:   Sun, 12 Jan 2025 18:02:55 -0800

Change type of r_trand

Diffstat:
Minc/rand.h | 2+-
Msrc/rand.c | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/inc/rand.h b/inc/rand.h @@ -31,7 +31,7 @@ void r_make_hash_key(u64 (*key)[4], u64 seed); * r_prand64) on program initialization. * TODO: Use getrandom instead? getrandom blocks when /dev/urandom doesn't have * enough entropy yet. */ -int r_trand(u8 *buf, usize len); +int r_trand(void *buf, usize len); /* Generate a pseudo-random u64 seeded from the given u64*, or from r_seed if * no argument is provided. Without an argument, r_prand is not thread-safe. diff --git a/src/rand.c b/src/rand.c @@ -88,7 +88,7 @@ r_make_hash_key(u64 (*key)[4], u64 seed) { } int -r_trand(u8 *buf, usize len) { +r_trand(void *buf, usize len) { int fd = open("/dev/urandom", O_RDONLY); if (fd < 0) return -1; if (r_read_all(0, fd, buf, len) < 0) {