]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix empty SID validation and generation
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 12 Oct 2009 13:09:14 +0000 (13:09 +0000)
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 12 Oct 2009 13:09:14 +0000 (13:09 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11851 e03df62e-2008-0410-955e-edbf42e46eb7

src/configreader.cpp
src/inspircd.cpp

index 22d4e36dcc9ea745f2e751ae2d306723c9d47afb..87ee8789b89b6dd23aa1f7bc6bfe7f32631b9455 100644 (file)
@@ -412,7 +412,7 @@ static bool ValidateSID(ServerConfig* conf, const char*, const char*, ValueItem
 
        const std::string& sid = data.GetValue();
 
-       if (!ServerInstance->IsSID(sid))
+       if (!sid.empty() && !ServerInstance->IsSID(sid))
        {
                throw CoreException(sid + " is not a valid server ID. A server ID must be 3 characters long, with the first character a digit and the next two characters a digit or letter.");
        }
index 7e9d56734fd2269fdfe9b7bb3a63d49b799af0d3..56e43c3ed89c88140976c61a7d04c731bfbe75a7 100644 (file)
@@ -568,7 +568,7 @@ InspIRCd::InspIRCd(int argc, char** argv) :
        if (Config->sid.empty())
        {
                // Generate one
-               int sid = 0;
+               unsigned int sid = 0;
                char sidstr[4];
 
                for (const char* x = Config->ServerName.c_str(); *x; ++x)