From 94fb9798c5476a9a3111f3982f357920b18c2fd0 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Wed, 24 Jun 2020 13:36:24 -0400 Subject: Bump ParamCap to 254 Apparently IRCds have decided that the 15-parameter limit doesn't matter anymore. 254 is the maximum number of single-byte parameters (following a single-byte command) which fit in a 512-byte CR-LF-terminated line. When everyone decides that the 512-byte line length limit doesn't matter either, I will delete my software and people can use some JavaScript garbage instead. This makes struct Message 2080 bytes, but there's only ever one or two of them around at once. Avoid passing it by value to handle. --- command.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'command.c') diff --git a/command.c b/command.c index 90732f3..ac83f3f 100644 --- a/command.c +++ b/command.c @@ -61,7 +61,7 @@ static void echoMessage(char *cmd, uint id, char *params) { .params[0] = idNames[id], .params[1] = params, }; - handle(msg); + handle(&msg); } static void splitMessage(char *cmd, uint id, char *params) { @@ -213,9 +213,7 @@ static void channelListMode(uint id, char pm, char l, const char *params) { for (const char *ch = params; *ch; ++ch) { if (*ch == ' ') count++; } - char modes[ParamCap - 2 + 1] = { - l, l, l, l, l, l, l, l, l, l, l, l, l, '\0' - }; + char modes[13 + 1] = { l, l, l, l, l, l, l, l, l, l, l, l, l, '\0' }; ircFormat("MODE %s %c%.*s %s\r\n", idNames[id], pm, count, modes, params); } -- cgit 1.4.1