[ircd-ratbox] Trailing whitespace in MODE message after SJOIN

Will Storey will at summercat.com
Thu Sep 8 05:25:30 UTC 2016


I noticed that there are trailing spaces in some cases in the MODE messages
sent by servers when processing an SJOIN message. I saw this happen when
servers join and modes got bursted over.

Here is an example of what I mean (message wrapped in [] to show spaces):

[:test.summercat.com MODE #test +o will   ]

I traced this to ms_sjoin() where there is this format string:

":%s MODE %s %s %s %s %s %s"

The last 3 %s arguments may be blank which leads to these trailing spaces.

It is not exactly a huge problem I know. I only ran into it as I was basing
some parsing code off RFC 2812's grammar. In RFC 1459 this appears possibly
valid, but not in RFC 2812. Perhaps it is still worth making a small update
for though.

I have attached a diff with a possible solution.

Thank you for your time.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spaces.diff
Type: text/x-diff
Size: 623 bytes
Desc: not available
URL: <http://lists.ratbox.org/pipermail/ircd-ratbox/attachments/20160907/102b7a21/attachment.diff>

More information about the ircd-ratbox mailing list