diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2011-12-23 19:02:52 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2011-12-23 19:02:52 +0100 |
commit | afa5e48a1a990efa1104610d687d3cdff5b49ee6 (patch) | |
tree | b36790777c63776826dbcec636f3509c21fbe56b /src/plugins/relay | |
parent | 7610b9b00cbc75d696f5cc4072feadb2c43c3b6c (diff) | |
download | weechat-afa5e48a1a990efa1104610d687d3cdff5b49ee6.zip |
relay: fix crash when not enough arguments are received in a command of weechat protocol
Diffstat (limited to 'src/plugins/relay')
-rw-r--r-- | src/plugins/relay/weechat/relay-weechat-protocol.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/plugins/relay/weechat/relay-weechat-protocol.h b/src/plugins/relay/weechat/relay-weechat-protocol.h index e1a34b9a5..f1ace5494 100644 --- a/src/plugins/relay/weechat/relay-weechat-protocol.h +++ b/src/plugins/relay/weechat/relay-weechat-protocol.h @@ -38,15 +38,19 @@ (void) command; \ (void) argv; \ (void) argv_eol; \ - if ((weechat_relay_plugin->debug >= 1) && (argc < __min_args)) \ + if (argc < __min_args) \ { \ - weechat_printf (NULL, \ - _("%s%s: too few arguments received from " \ - "client %d for command \"%s\" " \ - "(received: %d arguments, expected: at " \ - "least %d)"), \ - weechat_prefix ("error"), RELAY_PLUGIN_NAME, \ - client->id, command, argc, __min_args); \ + if (weechat_relay_plugin->debug >= 1) \ + { \ + weechat_printf (NULL, \ + _("%s%s: too few arguments received from " \ + "client %d for command \"%s\" " \ + "(received: %d arguments, expected: at " \ + "least %d)"), \ + weechat_prefix ("error"), \ + RELAY_PLUGIN_NAME, \ + client->id, command, argc, __min_args); \ + } \ return WEECHAT_RC_ERROR; \ } |