summaryrefslogtreecommitdiff
path: root/src/modules/m_opermotd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_opermotd.cpp')
-rw-r--r--src/modules/m_opermotd.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/modules/m_opermotd.cpp b/src/modules/m_opermotd.cpp
index b228dc8b7..aa5767b4c 100644
--- a/src/modules/m_opermotd.cpp
+++ b/src/modules/m_opermotd.cpp
@@ -107,9 +107,15 @@ class ModuleOpermotd : public Module
ConfigTag* conf = ServerInstance->Config->ConfValue("opermotd");
onoper = conf->getBool("onoper", true);
- FileReader f(conf->getString("file", "opermotd"));
- for (int i=0, filesize = f.FileSize(); i < filesize; i++)
- cmd.opermotd.push_back(f.GetLine(i));
+ try
+ {
+ FileReader reader(conf->getString("file", "opermotd"));
+ cmd.opermotd = reader.GetVector();
+ }
+ catch (CoreException&)
+ {
+ // Nothing happens here as we do the error handling in ShowOperMOTD.
+ }
if (conf->getBool("processcolors"))
InspIRCd::ProcessColors(cmd.opermotd);