]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspircd.cpp
Remove needless chdir() from inspircd executable
[user/henk/code/inspircd.git] / src / inspircd.cpp
index 8570097446be710ca3d62e2589f5e0ab5a2bc5f5..a932b95e10fe9aeabf4bd162527bd12d32d31370 100644 (file)
@@ -401,15 +401,6 @@ InspIRCd::InspIRCd(int argc, char** argv) :
        this->Config->argv = argv;
        this->Config->argc = argc;
 
-       if (chdir(Config->GetFullProgDir().c_str()))
-       {
-               printf("Unable to change to my directory: %s\nAborted.", strerror(errno));
-               exit(0);
-       }
-
-       this->Config->opertypes.clear();
-       this->Config->operclass.clear();
-
        this->TIME = this->OLDTIME = this->startup_time = time(NULL);
        srand(this->TIME);
 
@@ -568,15 +559,16 @@ InspIRCd::InspIRCd(int argc, char** argv) :
        if (Config->sid.empty())
        {
                // Generate one
-               size_t sid = 0;
+               unsigned int sid = 0;
+               char sidstr[4];
 
                for (const char* x = Config->ServerName.c_str(); *x; ++x)
                        sid = 5 * sid + *x;
                for (const char* y = Config->ServerDesc.c_str(); *y; ++y)
                        sid = 5 * sid + *y;
-               sid = sid % 999;
+               sprintf(sidstr, "%03d", sid % 1000);
 
-               Config->sid = ConvToStr(sid);
+               Config->sid = sidstr;
        }
 
        /* set up fake client again this time with the correct uid */