From 8373c86628bbde28ed7dadf32e7dec80e7045aa2 Mon Sep 17 00:00:00 2001 From: nia Date: Wed, 24 Jun 2020 17:15:02 +0100 Subject: [PATCH] entropy: Adjust parameter type of internal function to avoid a cast Signed-off-by: nia --- library/entropy_poll.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/library/entropy_poll.c b/library/entropy_poll.c index aaff26f48..dc621836e 100644 --- a/library/entropy_poll.c +++ b/library/entropy_poll.c @@ -129,9 +129,8 @@ static int getrandom_wrapper( void *buf, size_t buflen, unsigned int flags ) #if defined(KERN_ARND) #define HAVE_SYSCTL_ARND -static int sysctl_arnd_wrapper( void *buf, size_t buflen ) +static int sysctl_arnd_wrapper( unsigned char *buf, size_t buflen ) { - unsigned char *output = buf; int name[2]; size_t len; @@ -141,10 +140,10 @@ static int sysctl_arnd_wrapper( void *buf, size_t buflen ) while( buflen > 0 ) { len = buflen > 256 ? 256 : buflen; - if( sysctl(name, 2, output, &len, NULL, 0) == -1 ) + if( sysctl(name, 2, buf, &len, NULL, 0) == -1 ) return( -1 ); buflen -= len; - output += len; + buf += len; } return( 0 ); }