summaryrefslogtreecommitdiff
path: root/src/helperfuncs.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-02 03:15:46 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-02 03:15:46 +0000
commit8456cf5ccd44911f4e56538fe0880dd7fc7cd96d (patch)
tree3e1f96b94cc86506a615d8b39131ff6ea7c1b64c /src/helperfuncs.cpp
parent87d031609bb8b7d2cd186d8f24bcb853fd93798c (diff)
Fix valgrind issues and crashes on exit
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11794 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/helperfuncs.cpp')
-rw-r--r--src/helperfuncs.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp
index 155e29dd4..6c2ceabb2 100644
--- a/src/helperfuncs.cpp
+++ b/src/helperfuncs.cpp
@@ -17,7 +17,7 @@
#include "xline.h"
#include "exitcodes.h"
-std::string InspIRCd::GetServerDescription(const char* servername)
+std::string InspIRCd::GetServerDescription(const std::string& servername)
{
std::string description;
@@ -401,22 +401,21 @@ long InspIRCd::Duration(const std::string &str)
return total + subtotal;
}
-bool InspIRCd::ULine(const char* sserver)
+bool InspIRCd::ULine(const std::string& sserver)
{
- if (!sserver)
- return false;
- if (!*sserver)
+ if (sserver.empty())
return true;
- return (Config->ulines.find(sserver) != Config->ulines.end());
+ return (Config->ulines.find(sserver.c_str()) != Config->ulines.end());
}
-bool InspIRCd::SilentULine(const char* sserver)
+bool InspIRCd::SilentULine(const std::string& sserver)
{
- std::map<irc::string,bool>::iterator n = Config->ulines.find(sserver);
+ std::map<irc::string,bool>::iterator n = Config->ulines.find(sserver.c_str());
if (n != Config->ulines.end())
return n->second;
- else return false;
+ else
+ return false;
}
std::string InspIRCd::TimeString(time_t curtime)