]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/utils.cpp
Use it here, too
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / utils.cpp
index 42652d801d9688e39be7ebd4021de6b8e40f8de0..1e0788623e5d10f4c61493c05c68ea5a079bff71 100644 (file)
@@ -32,9 +32,9 @@
 bool SpanningTreeUtilities::IsSID(const std::string &str)
 {
        /* Returns true if the string given is exactly 3 characters long,
-        * contains no '.' chars and starts with a digit.
+        * starts with a digit, and has no '.' in the other 2
         */
-       return (str.length() == 3) && (str[0] != '.' && str[1] != '.' && str[2] != '.') && (isdigit(str[0]));
+       return ((str.length() == 3) && isdigit(str[0]) && (str[1] != '.' && str[2] != '.'));
 }
 
 /** Yay for fast searches!
@@ -176,17 +176,11 @@ SpanningTreeUtilities::SpanningTreeUtilities(InspIRCd* Instance, ModuleSpanningT
 {
        Bindings.clear();
 
-       std::string OurSID;
-
-       OurSID += (char)((Instance->Config->sid / 100) + 48);
-       OurSID += (char)((Instance->Config->sid / 10) % 10 + 48);
-       OurSID += (char)(Instance->Config->sid % 10 + 48);
-
        lines_to_apply = 0;
 
        ServerInstance->Log(DEBUG, "SpanningTreeUtilities: SID: %s", OurSID.c_str());
 
-       this->TreeRoot = new TreeServer(this, ServerInstance, ServerInstance->Config->ServerName, ServerInstance->Config->ServerDesc, OurSID);
+       this->TreeRoot = new TreeServer(this, ServerInstance, ServerInstance->Config->ServerName, ServerInstance->Config->ServerDesc, ServerInstance->Config->GetSID());
 
        modulelist* ml = ServerInstance->FindInterface("InspSocketHook");