mirror of
https://github.com/anope/anope.git
synced 2026-07-08 02:03:13 +02:00
Use the C++11 random number generator instead of rand().
This is safer, faster, and doesn't require seeding.
This commit is contained in:
@@ -246,7 +246,7 @@ public:
|
||||
int i = 0;
|
||||
do
|
||||
{
|
||||
guestnick = guestprefix + stringify(static_cast<uint16_t>(rand()));
|
||||
guestnick = guestprefix + stringify(static_cast<uint16_t>(Anope::RandomNumber()));
|
||||
if (guestnick.length() > nicklen)
|
||||
guestnick = guestnick.substr(0, nicklen);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user