From c788c9202694200d28b81f9e11a8b55fe9e152e4 Mon Sep 17 00:00:00 2001 From: scribam Date: Mon, 24 Jul 2023 13:20:02 +0200 Subject: [PATCH] Set seeded to true after srand/srandom --- lib/zip_random_unix.c | 1 + lib/zip_random_uwp.c | 1 + lib/zip_random_win32.c | 1 + 3 files changed, 3 insertions(+) diff --git a/lib/zip_random_unix.c b/lib/zip_random_unix.c index f84a5482a..fd9a67d29 100644 --- a/lib/zip_random_unix.c +++ b/lib/zip_random_unix.c @@ -95,6 +95,7 @@ zip_random_uint32(void) { if (!seeded) { srandom((unsigned int)time(NULL)); + seeded = true; } return (zip_uint32_t)random(); diff --git a/lib/zip_random_uwp.c b/lib/zip_random_uwp.c index 9f842b991..0883ce454 100644 --- a/lib/zip_random_uwp.c +++ b/lib/zip_random_uwp.c @@ -74,6 +74,7 @@ zip_random_uint32(void) { if (!seeded) { srand((unsigned int)time(NULL)); + seeded = true; } return (zip_uint32_t)rand(); diff --git a/lib/zip_random_win32.c b/lib/zip_random_win32.c index 966b9a5eb..789b9c205 100644 --- a/lib/zip_random_win32.c +++ b/lib/zip_random_win32.c @@ -74,6 +74,7 @@ zip_random_uint32(void) { if (!seeded) { srand((unsigned int)time(NULL)); + seeded = true; } return (zip_uint32_t)rand();