summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/init.cpp2
-rw-r--r--src/xline.cpp6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/init.cpp b/src/init.cpp
index dbcdea02c..fae776f9b 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -447,7 +447,7 @@ void Anope::Init(int ac, char **av)
/* Initialize random number generator */
block = Config->GetBlock("options");
- srand(block->Get<unsigned>("seed"));
+ srand(block->Get<unsigned>("seed") ^ time(NULL));
/* load modules */
Log() << "Loading modules...";
diff --git a/src/xline.cpp b/src/xline.cpp
index 554632a38..a5087109c 100644
--- a/src/xline.cpp
+++ b/src/xline.cpp
@@ -220,11 +220,12 @@ Anope::string XLineManager::GenerateUID()
{
Anope::string id;
int count = 0;
- while (id.empty() || XLinesByUID->count(id) > 0)
+ do
{
+ id.clear();
+
if (++count > 10)
{
- id.clear();
Log(LOG_DEBUG) << "Unable to generate XLine UID";
break;
}
@@ -238,6 +239,7 @@ Anope::string XLineManager::GenerateUID()
id += c;
}
}
+ while (XLinesByUID->count(id) > 0);
return id;
}