]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/helperfuncs.cpp
Conversions
[user/henk/code/inspircd.git] / src / helperfuncs.cpp
index 6e5f616bd37800b40d8abff9d2585a1b5e668b6f..f5d9aa5d91524cd7540fe3aac6da7afaf2bc6e6d 100644 (file)
@@ -11,6 +11,7 @@
  * ---------------------------------------------------
  */
 
+#include "inspircd.h"
 #include <stdarg.h>
 #include "configreader.h"
 #include "users.h"
@@ -18,7 +19,6 @@
 #include "wildcard.h"
 #include "mode.h"
 #include "xline.h"
-#include "inspircd.h"
 #include "exitcodes.h"
 
 static char TIMESTR[26];
@@ -81,7 +81,7 @@ std::string InspIRCd::GetServerDescription(const char* servername)
 
        FOREACH_MOD_I(this,I_OnGetServerDescription,OnGetServerDescription(servername,description));
 
-       if (description != "")
+       if (!description.empty())
        {
                return description;
        }
@@ -431,11 +431,11 @@ bool InspIRCd::IsIdent(const char* n)
 
 void InspIRCd::OpenLog(char** argv, int argc)
 {
-       Config->MyDir = ServerConfig::GetFullProgDir(argv,argc);
+       Config->MyDir = Config->GetFullProgDir();
 
        if (!*this->LogFileName)
        {
-               if (Config->logpath == "")
+               if (Config->logpath.empty())
                {
                        Config->logpath = Config->MyDir + "/ircd.log";
                }
@@ -486,16 +486,16 @@ void InspIRCd::LoadAllModules()
        for (int count = 0; count < Config->ConfValueEnum(Config->config_data, "module"); count++)
        {
                Config->ConfValue(Config->config_data, "module", "name", count, configToken, MAXBUF);
-               printf("[\033[1;32m*\033[0m] Loading module:\t\033[1;32m%s\033[0m\n",configToken);
+               printf_c("[\033[1;32m*\033[0m] Loading module:\t\033[1;32m%s\033[0m\n",configToken);
                
                if (!this->LoadModule(configToken))             
                {
                        this->Log(DEFAULT,"There was an error loading the module '%s': %s", configToken, this->ModuleError());
-                       printf("\n[\033[1;31m*\033[0m] There was an error loading the module '%s': %s\n\n", configToken, this->ModuleError());
+                       printf_c("\n[\033[1;31m*\033[0m] There was an error loading the module '%s': %s\n\n", configToken, this->ModuleError());
                        Exit(EXIT_STATUS_MODULE);
                }
        }
-       printf("\nA total of \033[1;32m%d\033[0m module%s been loaded.\n", this->ModCount+1, this->ModCount+1 == 1 ? " has" : "s have");
+       printf_c("\nA total of \033[1;32m%d\033[0m module%s been loaded.\n", this->ModCount+1, this->ModCount+1 == 1 ? " has" : "s have");
        this->Log(DEFAULT,"Total loaded modules: %d", this->ModCount+1);
 }