1
0
mirror of https://github.com/anope/anope.git synced 2026-07-05 21:13:13 +02:00

Fix xline uid generation when the one chosen already exists

This commit is contained in:
Adam
2013-10-01 23:48:46 -04:00
parent b094132c9d
commit 353ee5cc93
2 changed files with 5 additions and 3 deletions
+4 -2
View File
@@ -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;
}