diff options
Diffstat (limited to 'src/xline.cpp')
-rw-r--r-- | src/xline.cpp | 6 |
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; } |