From f4019b6740e26667a1654d6cbf1e3a8dd61e9ec6 Mon Sep 17 00:00:00 2001 From: Lee Aylward Date: Wed, 7 Dec 2011 19:09:23 -0600 Subject: [PATCH] send 422 event if MOTD buffer is empty --- src/IRCNetwork.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/IRCNetwork.cpp b/src/IRCNetwork.cpp index 549ce3c2..3625b5a7 100644 --- a/src/IRCNetwork.cpp +++ b/src/IRCNetwork.cpp @@ -403,9 +403,14 @@ void CIRCNetwork::ClientConnected(CClient *pClient) { // Send the cached MOTD uSize = m_MotdBuffer.Size(); - for (uIdx = 0; uIdx < uSize; uIdx++) { - pClient->PutClient(m_MotdBuffer.GetLine(uIdx, *pClient, msParams)); - } + if (uSize > 0) { + for (uIdx = 0; uIdx < uSize; uIdx++) { + pClient->PutClient(m_MotdBuffer.GetLine(uIdx, *pClient, msParams)); + } + } + else { + pClient->PutClient(":irc.znc.in 422 :MOTD File is missing"); + } if (GetIRCSock() != NULL) { CString sUserMode("");