summaryrefslogtreecommitdiff
path: root/src/configreader.cpp
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2013-07-10 13:05:59 +0100
committerPeter Powell <petpow@saberuk.com>2013-08-10 14:04:09 +0100
commita129233dcd4356814c8c781b4c4dc1951c4ca44c (patch)
treea48e09f8f6a5d9b70fad73b26cb6083f4e4c06e6 /src/configreader.cpp
parent03a623a284b6c9f2f11f549c55333c45c4d91eab (diff)
Use an example server name if <server:name> is not defined.
Diffstat (limited to 'src/configreader.cpp')
-rw-r--r--src/configreader.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index dba23e27f..f6a9bbd4b 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -359,9 +359,10 @@ void ServerConfig::Fill()
ConfigTag* security = ConfValue("security");
if (sid.empty())
{
- ServerName = ConfValue("server")->getString("name");
- sid = ConfValue("server")->getString("id");
+ ServerName = ConfValue("server")->getString("name", "irc.example.com");
ValidHost(ServerName, "<server:name>");
+
+ sid = ConfValue("server")->getString("id");
if (!sid.empty() && !InspIRCd::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.");
}