summary refs log tree commit diff
path: root/handle.c
diff options
context:
space:
mode:
authorC. McEnroe2021-06-10 19:38:12 -0400
committerC. McEnroe2021-06-10 19:38:12 -0400
commit7e4fa80c9629ac582523d4ee84e32196d6169ae2 (patch)
tree5c9d7124b2b0f400b6d5327fbeca69436dd4103e /handle.c
parent275d657b8b3bccd7d7d6055cbe09de4e85be7659 (diff)
Avoid trailing comma in whois channels lists
The format of the reply is defined as "<nick> :{[@|+]<channel><space>}".
Diffstat (limited to 'handle.c')
-rw-r--r--handle.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/handle.c b/handle.c
index 012b4ea..844fb74 100644
--- a/handle.c
+++ b/handle.c
@@ -1082,6 +1082,7 @@ static void handleReplyWhoisChannels(struct Message *msg) {
 	char *ptr = buf, *end = &buf[sizeof(buf)];
 	while (msg->params[2]) {
 		char *channel = strsep(&msg->params[2], " ");
+		if (!channel[0]) break;
 		char *name = &channel[strspn(channel, network.prefixes)];
 		ptr = seprintf(
 			ptr, end, "%s\3%02d%s\3",