From 7e7c841eaddd4dd66c6f1db98e4f584fa4fc8baf Mon Sep 17 00:00:00 2001 From: Wouter Coekaerts Date: Sun, 20 Aug 2006 17:56:06 +0000 Subject: Don't get confused by a join command with too many arguments; keys can't have spaces in them. (Bug 437) git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4322 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/irc/core/irc-channels.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/irc') diff --git a/src/irc/core/irc-channels.c b/src/irc/core/irc-channels.c index 431f2458..a67504ed 100644 --- a/src/irc/core/irc-channels.c +++ b/src/irc/core/irc-channels.c @@ -69,7 +69,7 @@ static void irc_channels_join(IRC_SERVER_REC *server, const char *data, CHANNEL_SETUP_REC *schannel; IRC_CHANNEL_REC *chanrec; GString *outchans, *outkeys; - char *channels, *keys, *key; + char *channels, *keys, *key, *space; char **chanlist, **keylist, **tmp, **tmpkey, **tmpstr, *channel, *channame; void *free_arg; int use_keys, cmdlen; @@ -82,6 +82,12 @@ static void irc_channels_join(IRC_SERVER_REC *server, const char *data, &channels, &keys)) return; + /* keys shouldn't contain space */ + space = strchr(keys, ' '); + if (space != NULL) { + *space = '\0'; + } + chanlist = g_strsplit(channels, ",", -1); keylist = g_strsplit(keys, ",", -1); -- cgit v1.2.3