diff options
Diffstat (limited to '')
-rw-r--r-- | cipher/random.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cipher/random.c b/cipher/random.c index 396e1dbd9..eb4fdf793 100644 --- a/cipher/random.c +++ b/cipher/random.c @@ -304,10 +304,12 @@ read_pool( byte *buffer, size_t length, int level ) static void add_randomness( const void *buffer, size_t length, int source ) { + const byte *p = buffer; + if( !is_initialized ) initialize(); while( length-- ) { - rndpool[pool_writepos++] = *((byte*)buffer)++; + rndpool[pool_writepos++] = *p++; if( pool_writepos >= POOLSIZE ) { if( source > 1 ) pool_filled = 1; |