summaryrefslogtreecommitdiff
path: root/src/modules/extra
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/extra')
-rw-r--r--src/modules/extra/m_sqlauth.cpp2
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp11
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp14
-rw-r--r--src/modules/extra/m_ziplink.cpp6
4 files changed, 16 insertions, 17 deletions
diff --git a/src/modules/extra/m_sqlauth.cpp b/src/modules/extra/m_sqlauth.cpp
index 530d84c57..36dcb0952 100644
--- a/src/modules/extra/m_sqlauth.cpp
+++ b/src/modules/extra/m_sqlauth.cpp
@@ -88,7 +88,7 @@ public:
virtual int OnUserRegister(userrec* user)
{
- if ((allowpattern != "") && (ServerInstance->MatchText(user->nick,allowpattern)))
+ if ((!allowpattern.empty()) && (ServerInstance->MatchText(user->nick,allowpattern)))
{
user->Extend("sqlauthed");
return 0;
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp
index a466eb66d..ce2239a42 100644
--- a/src/modules/extra/m_ssl_gnutls.cpp
+++ b/src/modules/extra/m_ssl_gnutls.cpp
@@ -128,7 +128,8 @@ class ModuleSSLGnuTLS : public Module
for(int i = 0; i < Conf->Enumerate("bind"); i++)
{
// For each <bind> tag
- if(((Conf->ReadValue("bind", "type", i) == "") || (Conf->ReadValue("bind", "type", i) == "clients")) && (Conf->ReadValue("bind", "ssl", i) == "gnutls"))
+ std::string x = Conf->ReadValue("bind", "type", i);
+ if(((x.empty()) || (x == "clients")) && (x == "gnutls"))
{
// Get the port we're meant to be listening on with SSL
std::string port = Conf->ReadValue("bind", "port", i);
@@ -171,16 +172,16 @@ class ModuleSSLGnuTLS : public Module
dh_bits = Conf->ReadInteger("gnutls", "dhbits", 0, false);
// Set all the default values needed.
- if(cafile == "")
+ if (cafile.empty())
cafile = "ca.pem";
- if(crlfile == "")
+ if (crlfile.empty())
crlfile = "crl.pem";
- if(certfile == "")
+ if (certfile.empty())
certfile = "cert.pem";
- if(keyfile == "")
+ if (keyfile.empty())
keyfile = "key.pem";
if((dh_bits != 768) && (dh_bits != 1024) && (dh_bits != 2048) && (dh_bits != 3072) && (dh_bits != 4096))
diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp
index 7090f1a01..4ac684843 100644
--- a/src/modules/extra/m_ssl_openssl.cpp
+++ b/src/modules/extra/m_ssl_openssl.cpp
@@ -172,7 +172,8 @@ class ModuleSSLOpenSSL : public Module
for (int i = 0; i < Conf->Enumerate("bind"); i++)
{
// For each <bind> tag
- if (((Conf->ReadValue("bind", "type", i) == "") || (Conf->ReadValue("bind", "type", i) == "clients")) && (Conf->ReadValue("bind", "ssl", i) == "openssl"))
+ std::string x = Conf->ReadValue("bind", "type", i);
+ if (((x.empty()) || (x == "clients")) && (x == "openssl"))
{
// Get the port we're meant to be listening on with SSL
std::string port = Conf->ReadValue("bind", "port", i);
@@ -214,25 +215,22 @@ class ModuleSSLOpenSSL : public Module
dhfile = Conf->ReadValue("openssl", "dhfile", 0);
// Set all the default values needed.
- if (cafile == "")
+ if (cafile.empty())
cafile = "ca.pem";
- if (certfile == "")
+ if (certfile.empty())
certfile = "cert.pem";
- if (keyfile == "")
+ if (keyfile.empty())
keyfile = "key.pem";
- if (dhfile == "")
+ if (dhfile.empty())
dhfile = "dhparams.pem";
// Prepend relative paths with the path to the config directory.
if (cafile[0] != '/')
cafile = confdir + cafile;
- //if(crlfile[0] != '/')
- // crlfile = confdir + crlfile;
-
if (certfile[0] != '/')
certfile = confdir + certfile;
diff --git a/src/modules/extra/m_ziplink.cpp b/src/modules/extra/m_ziplink.cpp
index 1e9c32d26..e0b0afca6 100644
--- a/src/modules/extra/m_ziplink.cpp
+++ b/src/modules/extra/m_ziplink.cpp
@@ -419,13 +419,13 @@ class ModuleZLib : public Module
return 0;
else
{
- session->outbuf = "";
+ session->outbuf.clear();
return 0;
}
}
else
{
- session->outbuf = "";
+ session->outbuf.clear();
return 0;
}
}
@@ -441,7 +441,7 @@ class ModuleZLib : public Module
if (session->status == IZIP_OPEN)
{
session->status = IZIP_CLOSED;
- session->outbuf = "";
+ session->outbuf.clear();
delete session->inbuf;
}
}