Skip to content

Commit

Permalink
Set seeded to true after srand/srandom
Browse files Browse the repository at this point in the history
  • Loading branch information
scribam authored and dillof committed Jul 24, 2023
1 parent c93eec6 commit c788c92
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/zip_random_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ zip_random_uint32(void) {

if (!seeded) {
srandom((unsigned int)time(NULL));
seeded = true;
}

return (zip_uint32_t)random();
Expand Down
1 change: 1 addition & 0 deletions lib/zip_random_uwp.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ zip_random_uint32(void) {

if (!seeded) {
srand((unsigned int)time(NULL));
seeded = true;
}

return (zip_uint32_t)rand();
Expand Down
1 change: 1 addition & 0 deletions lib/zip_random_win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ zip_random_uint32(void) {

if (!seeded) {
srand((unsigned int)time(NULL));
seeded = true;
}

return (zip_uint32_t)rand();
Expand Down

0 comments on commit c788c92

Please sign in to comment.