summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p@janouch.name>2018-08-01 09:24:35 +0200
committerPřemysl Janouch <p@janouch.name>2018-10-21 05:40:16 +0200
commit2fccfb10f701f3b38eb7555e0f192f267f850001 (patch)
treed5d29c7ba91a2cd9345f1132621cf771670204b5
parentb9eddabeddb68157a29a5fa5810d8c0dc3680aaa (diff)
downloadxK-2fccfb10f701f3b38eb7555e0f192f267f850001.tar.gz
xK-2fccfb10f701f3b38eb7555e0f192f267f850001.tar.xz
xK-2fccfb10f701f3b38eb7555e0f192f267f850001.zip
kike: allow STATS with no parameters
We were in plain conflict with RFC 2812 for no apparent reason.
-rw-r--r--kike.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kike.c b/kike.c
index dfabc9c..64bebc9 100644
--- a/kike.c
+++ b/kike.c
@@ -2894,9 +2894,9 @@ irc_handle_stats_uptime (struct client *c)
static void
irc_handle_stats (const struct irc_message *msg, struct client *c)
{
- char query;
- if (msg->params.len < 1 || !(query = *msg->params.vector[0]))
- RETURN_WITH_REPLY (c, IRC_ERR_NEEDMOREPARAMS, msg->command);
+ char query = 0;
+ if (msg->params.len > 0)
+ query = *msg->params.vector[0];
if (msg->params.len > 1 && !irc_is_this_me (c->ctx, msg->params.vector[1]))
RETURN_WITH_REPLY (c, IRC_ERR_NOSUCHSERVER, msg->params.vector[1]);
if (!(c->mode & IRC_USER_MODE_OPERATOR))
@@ -2909,7 +2909,7 @@ irc_handle_stats (const struct irc_message *msg, struct client *c)
case 'u': irc_handle_stats_uptime (c); break;
}
- irc_send_reply (c, IRC_RPL_ENDOFSTATS, query);
+ irc_send_reply (c, IRC_RPL_ENDOFSTATS, query ? query : '*');
}
static void