--- a/libpurple/protocols/irc/msgs.c Thu Jan 16 11:46:05 2014 +0100
+++ b/libpurple/protocols/irc/msgs.c Thu Jan 16 12:11:19 2014 +0100
@@ -203,9 +203,6 @@
- if (!args || !args[0] || !args[1])
features = g_strsplit(args[1], " ", -1);
for (i = 0; features[i]; i++) {
@@ -220,9 +217,6 @@
void irc_msg_luser(struct irc_conn *irc, const char *name, const char *from, char **args)
if (!strcmp(name, "251")) {
/* 251 is required, so we pluck our nick from here and
@@ -238,9 +232,6 @@
if (irc->whois.nick && !purple_utf8_strcasecmp(irc->whois.nick, args[1])) {
/* We're doing a whois, show this in the whois dialog */
irc_msg_whois(irc, name, from, args);
@@ -266,17 +257,13 @@
PurpleConversation *convo;
- if (!args || !args[0] || !args[1])
convo = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT,
if (!strcmp(name, "367")) {
+ g_return_if_fail(args[2]); if (args[3] && args[4]) {
/* This is an extended syntax, not in RFC 1459 */
@@ -340,9 +327,6 @@
PurpleConversation *convo;
- if (!args || !args[1] || !args[2])
convo = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, args[1], irc->account);
if (!convo) /* XXX punt on channels we are not in for now */
@@ -480,13 +464,6 @@
PurpleConvChatBuddyFlags flags;
GList *keys = NULL, *values = NULL;
- if (!args || !args[0] || !args[1] || !args[2] || !args[3]
- || !args[4] || !args[5] || !args[6] || !args[7]) {
- purple_debug(PURPLE_DEBUG_ERROR, "irc",
- "Got a WHO response with not enough arguments\n");
conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, args[1], irc->account);
purple_debug(PURPLE_DEBUG_ERROR, "irc","Got a WHO response for %s, which doesn't exist\n", args[1]);
@@ -562,9 +539,6 @@
PurpleRoomlistRoom *room;
- if (!args[0] || !args[1] || !args[2] || !args[3])
if (!purple_roomlist_get_in_progress(irc->roomlist)) {
purple_debug_warning("irc", "Buggy server didn't send RPL_LISTSTART.\n");
purple_roomlist_set_in_progress(irc->roomlist, TRUE);
@@ -643,9 +617,6 @@
char *msg, *timestamp, *datestamp;
- if (!args || !args[1] || !args[2] || !args[3])
convo = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, args[1], irc->account);
@@ -910,9 +881,6 @@
nicks = g_strsplit(args[1], " ", -1);
for (i = 0; nicks[i]; i++) {
if ((ib = g_hash_table_lookup(irc->buddies, (gconstpointer)nicks[i])) == NULL) {
--- a/libpurple/protocols/irc/parse.c Thu Jan 16 11:46:05 2014 +0100
+++ b/libpurple/protocols/irc/parse.c Thu Jan 16 12:11:19 2014 +0100
@@ -50,36 +50,38 @@
+ /* The required parameters count, based on values we use, not protocol void (*cb)(struct irc_conn *irc, const char *name, const char *from, char **args);
- { "005", "n*", -1, irc_msg_features }, /* Feature list */
- { "251", "n:", -1, irc_msg_luser }, /* Client & Server count */
- { "255", "n:", -1, irc_msg_luser }, /* Client & Server count Mk. II */
- { "301", "nn:", -1, irc_msg_away }, /* User is away */
- { "303", "n:", -1, irc_msg_ison }, /* ISON reply */
- { "311", "nnvvv:", -1, irc_msg_whois }, /* Whois user */
- { "312", "nnv:", -1, irc_msg_whois }, /* Whois server */
- { "313", "nn:", -1, irc_msg_whois }, /* Whois ircop */
- { "317", "nnvv", -1, irc_msg_whois }, /* Whois idle */
- { "318", "nt:", -1, irc_msg_endwhois }, /* End of WHOIS */
- { "319", "nn:", -1, irc_msg_whois }, /* Whois channels */
- { "320", "nn:", -1, irc_msg_whois }, /* Whois (fn ident) */
- { "314", "nnnvv:", -1, irc_msg_whois }, /* Whowas user */
- { "315", "nt:", -1, irc_msg_who }, /* end of WHO channel */
- { "369", "nt:", -1, irc_msg_endwhois }, /* End of WHOWAS */
- { "321", "*", -1, irc_msg_list }, /* Start of list */
- { "322", "ncv:", -1, irc_msg_list }, /* List. */
- { "323", ":", -1, irc_msg_list }, /* End of list. */
- { "324", "ncv:", -1, irc_msg_chanmode }, /* Channel modes */
+ { "005", "n*", 2, irc_msg_features }, /* Feature list */ + { "251", "n:", 1, irc_msg_luser }, /* Client & Server count */ + { "255", "n:", 1, irc_msg_luser }, /* Client & Server count Mk. II */ + { "301", "nn:", 3, irc_msg_away }, /* User is away */ + { "303", "n:", 2, irc_msg_ison }, /* ISON reply */ + { "311", "nnvvv:", 6, irc_msg_whois }, /* Whois user */ + { "312", "nnv:", 4, irc_msg_whois }, /* Whois server */ + { "313", "nn:", 2, irc_msg_whois }, /* Whois ircop */ + { "317", "nnvv", 4, irc_msg_whois }, /* Whois idle */ + { "318", "nt:", 2, irc_msg_endwhois }, /* End of WHOIS */ + { "319", "nn:", 3, irc_msg_whois }, /* Whois channels */ + { "320", "nn:", 2, irc_msg_whois }, /* Whois (fn ident) */ + { "314", "nnnvv:", 6, irc_msg_whois }, /* Whowas user */ + { "315", "nt:", 0, irc_msg_who }, /* end of WHO channel */ + { "369", "nt:", 2, irc_msg_endwhois }, /* End of WHOWAS */ + { "321", "*", 0, irc_msg_list }, /* Start of list */ + { "322", "ncv:", 4, irc_msg_list }, /* List. */ + { "323", ":", 0, irc_msg_list }, /* End of list. */ + { "324", "ncv:", 3, irc_msg_chanmode }, /* Channel modes */ { "331", "nc:", 3, irc_msg_topic }, /* No channel topic */
{ "332", "nc:", 3, irc_msg_topic }, /* Channel topic */
- { "333", "ncvv", -1, irc_msg_topicinfo }, /* Topic setter stuff */
- { "352", "ncvvvnv:", -1, irc_msg_who }, /* Channel WHO */
- { "353", "nvc:", -1, irc_msg_names }, /* Names list */
- { "366", "nc:", -1, irc_msg_names }, /* End of names */
- { "367", "ncnnv", -1, irc_msg_ban }, /* Ban list */
- { "368", "nc:", -1, irc_msg_ban }, /* End of ban list */
+ { "333", "ncvv", 4, irc_msg_topicinfo }, /* Topic setter stuff */ + { "352", "ncvvvnv:", 8, irc_msg_who }, /* Channel WHO */ + { "353", "nvc:", 4, irc_msg_names }, /* Names list */ + { "366", "nc:", 2, irc_msg_names }, /* End of names */ + { "367", "ncnnv", 3, irc_msg_ban }, /* Ban list */ + { "368", "nc:", 2, irc_msg_ban }, /* End of ban list */ { "372", "n:", 1, irc_msg_motd }, /* MOTD */
{ "375", "n:", 1, irc_msg_motd }, /* Start MOTD */
{ "376", "n:", 1, irc_msg_motd }, /* End of MOTD */