Skip to content

Commit

Permalink
added random seed setting
Browse files Browse the repository at this point in the history
  • Loading branch information
imperzer0 committed Dec 17, 2022
1 parent f837839 commit 8bf9177
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,8 @@ inline id_t generate_id_and_send_email(struct mg_connection* connection, struct

std::string server_address_str(server_address->ptr, server_address->len);

srandom(mg_millis());

id_t id = random();
for (int i = 0; id == 0 || ftp_users_pending.contains(id) && i < 10; ++i) id = random();
if (ftp_users_pending.contains(id))
Expand Down

0 comments on commit 8bf9177

Please sign in to comment.