summaryrefslogtreecommitdiff
path: root/src/xline.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-10-01 23:48:46 -0400
committerAdam <Adam@anope.org>2013-10-05 00:33:03 -0400
commit353ee5cc933b96e92fad807a784ba40505e95a00 (patch)
treee3cfba4a40cff01e0cc907ff20a0a3638ad3a6c4 /src/xline.cpp
parentb094132c9d1dff2869efd70f3d6f8d1654331780 (diff)
Fix xline uid generation when the one chosen already exists
Diffstat (limited to 'src/xline.cpp')
-rw-r--r--src/xline.cpp6
1 files changed, 4 insertions, 2 deletions
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;
}