From 619d294e9d2d9bb64c4eac62fde57096d5a84ba4 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Mon, 6 Apr 2020 09:49:02 -0400 Subject: Remove QUtil::srandom --- libqpdf/QUtil.cc | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'libqpdf/QUtil.cc') diff --git a/libqpdf/QUtil.cc b/libqpdf/QUtil.cc index 8717e148..177b49e1 100644 --- a/libqpdf/QUtil.cc +++ b/libqpdf/QUtil.cc @@ -878,16 +878,6 @@ QUtil::toUTF16(unsigned long uval) // Random data support -long -QUtil::random() -{ - long result = 0L; - initializeWithRandomBytes( - reinterpret_cast(&result), - sizeof(result)); - return result; -} - static RandomDataProvider* random_data_provider = 0; #ifdef USE_INSECURE_RANDOM @@ -941,14 +931,14 @@ QUtil::initializeWithRandomBytes(unsigned char* data, size_t len) random_data_provider->provideRandomData(data, len); } -void -QUtil::srandom(unsigned int seed) +long +QUtil::random() { -#ifdef HAVE_RANDOM - ::srandom(seed); -#else - srand(seed); -#endif + long result = 0L; + initializeWithRandomBytes( + reinterpret_cast(&result), + sizeof(result)); + return result; } bool -- cgit v1.2.3-70-g09d2