VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/libzip/zip_random_unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common/libzip/zip_random_unix.c')
-rw-r--r--src/Common/libzip/zip_random_unix.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Common/libzip/zip_random_unix.c b/src/Common/libzip/zip_random_unix.c
index f84a5482..867df790 100644
--- a/src/Common/libzip/zip_random_unix.c
+++ b/src/Common/libzip/zip_random_unix.c
@@ -83,6 +83,11 @@ zip_secure_random(zip_uint8_t *buffer, zip_uint16_t length) {
#ifndef HAVE_RANDOM_UINT32
#include <stdlib.h>
+#ifndef HAVE_RANDOM
+#define srandom srand
+#define random rand
+#endif
+
zip_uint32_t
zip_random_uint32(void) {
static bool seeded = false;
@@ -95,6 +100,7 @@ zip_random_uint32(void) {
if (!seeded) {
srandom((unsigned int)time(NULL));
+ seeded = true;
}
return (zip_uint32_t)random();