summaryrefslogtreecommitdiff
path: root/src/plugins/irc/irc-command.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2009-03-01 22:32:13 +0100
committerSebastien Helleu <flashcode@flashtux.org>2009-03-01 22:32:13 +0100
commit371bf4b401fab44f18bf8766cd434116da14425a (patch)
tree42b778913afd7f476806a14fe8b91662736f7e77 /src/plugins/irc/irc-command.c
parent882be565c331efe10bb45a5f9fd3b0fd35a8222d (diff)
downloadweechat-371bf4b401fab44f18bf8766cd434116da14425a.zip
Fix crash with IRC commands msg/notice/query/quote when executed with too few arguments (bug #25739)
Diffstat (limited to 'src/plugins/irc/irc-command.c')
-rw-r--r--src/plugins/irc/irc-command.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c
index 4f12b1287..97361203e 100644
--- a/src/plugins/irc/irc-command.c
+++ b/src/plugins/irc/irc-command.c
@@ -1972,7 +1972,8 @@ irc_command_msg (void *data, struct t_gui_buffer *buffer, int argc,
if (argc <= 2)
{
- IRC_COMMAND_TOO_FEW_ARGUMENTS(ptr_server->buffer, "msg");
+ IRC_COMMAND_TOO_FEW_ARGUMENTS((ptr_server) ? ptr_server->buffer : NULL,
+ "msg");
}
arg_target = 1;
@@ -2252,7 +2253,8 @@ irc_command_notice (void *data, struct t_gui_buffer *buffer, int argc,
}
else
{
- IRC_COMMAND_TOO_FEW_ARGUMENTS(ptr_server->buffer, "notice");
+ IRC_COMMAND_TOO_FEW_ARGUMENTS((ptr_server) ? ptr_server->buffer : NULL,
+ "notice");
}
return WEECHAT_RC_OK;
@@ -2529,7 +2531,8 @@ irc_command_query (void *data, struct t_gui_buffer *buffer, int argc,
}
else
{
- IRC_COMMAND_TOO_FEW_ARGUMENTS(ptr_server->buffer, "query");
+ IRC_COMMAND_TOO_FEW_ARGUMENTS((ptr_server) ? ptr_server->buffer : NULL,
+ "query");
}
return WEECHAT_RC_OK;
@@ -2566,7 +2569,8 @@ irc_command_quote (void *data, struct t_gui_buffer *buffer, int argc,
}
else
{
- IRC_COMMAND_TOO_FEW_ARGUMENTS(ptr_server->buffer, "quote");
+ IRC_COMMAND_TOO_FEW_ARGUMENTS((ptr_server) ? ptr_server->buffer : NULL,
+ "quote");
}
return WEECHAT_RC_OK;