Avoid trailing comma in whois channels lists

The format of the reply is defined as "<nick> :{[@|+]<channel><space>}".
master
C. McEnroe 2021-06-10 19:38:12 -04:00
parent 275d657b8b
commit 7e4fa80c96
1 changed files with 1 additions and 0 deletions

View File

@ -1082,6 +1082,7 @@ static void handleReplyWhoisChannels(struct Message *msg) {
char *ptr = buf, *end = &buf[sizeof(buf)]; char *ptr = buf, *end = &buf[sizeof(buf)];
while (msg->params[2]) { while (msg->params[2]) {
char *channel = strsep(&msg->params[2], " "); char *channel = strsep(&msg->params[2], " ");
if (!channel[0]) break;
char *name = &channel[strspn(channel, network.prefixes)]; char *name = &channel[strspn(channel, network.prefixes)];
ptr = seprintf( ptr = seprintf(
ptr, end, "%s\3%02d%s\3", ptr, end, "%s\3%02d%s\3",