summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorValentin Lorentz <progval+git@progval.net>2023-09-03 10:05:54 +0200
committerAlexander Barton <alex@barton.de>2023-09-17 22:25:40 +0200
commit0714466af88d71d6c395629cd7fb624b099507d4 (patch)
tree2445ec88a28dd5bad26379aedae479526ccf3a14 /src
parent445e559dbd6447508ad870d1830fd299964f62ba (diff)
downloadngircd-0714466af88d71d6c395629cd7fb624b099507d4.tar.gz
ngircd-0714466af88d71d6c395629cd7fb624b099507d4.zip
Return ERR_NOTEXTTOSEND on empty PRIVMSG content
They are dropped further down the line anyway; and sending ERR_NOTEXTTOSEND
early matches other servers' behavior.
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/irc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ngircd/irc.c b/src/ngircd/irc.c
index ba33e5ae..5cf4fe23 100644
--- a/src/ngircd/irc.c
+++ b/src/ngircd/irc.c
@@ -572,6 +572,13 @@ Send_Message(CLIENT * Client, REQUEST * Req, int ForceType, bool SendErrors)
 #endif
 		message = Req->argv[1];
 
+	if (message[0] == '\0') {
+		if (!SendErrors)
+			return CONNECTED;
+		return IRC_WriteErrClient(Client, ERR_NOTEXTTOSEND_MSG,
+					  Client_ID(Client));
+	}
+
 	/* handle msgtarget = msgto *("," msgto) */
 	currentTarget = strtok_r(currentTarget, ",", &strtok_last);
 	ngt_UpperStr(Req->command);