From e2ba5a63f0585cd8058d0ee1ff7d683d9097650f Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Fri, 15 Dec 2000 15:27:24 +0000 Subject: [PATCH] Bug fix --- apps/silcd/command.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/apps/silcd/command.c b/apps/silcd/command.c index b8c2030b..cf17f380 100644 --- a/apps/silcd/command.c +++ b/apps/silcd/command.c @@ -85,13 +85,13 @@ do { \ SILC_LOG_DEBUG(("Start")); \ \ if (_argc < min) { \ - silc_server_command_send_status_reply(cmd, SILC_COMMAND_WHOIS, \ + silc_server_command_send_status_reply(cmd, command, \ SILC_STATUS_ERR_NOT_ENOUGH_PARAMS); \ silc_server_command_free(cmd); \ return; \ } \ if (_argc > max) { \ - silc_server_command_send_status_reply(cmd, SILC_COMMAND_WHOIS, \ + silc_server_command_send_status_reply(cmd, command, \ SILC_STATUS_ERR_TOO_MANY_PARAMS); \ silc_server_command_free(cmd); \ return; \ @@ -1890,26 +1890,13 @@ SILC_SERVER_CMD_FUNC(join) { SilcServerCommandContext cmd = (SilcServerCommandContext)context; SilcServer server = cmd->server; - int argc, tmp_len; + int tmp_len; char *tmp, *channel_name = NULL, *cipher = NULL; SilcChannelEntry channel; unsigned int umode = 0; int created = FALSE; - SILC_LOG_DEBUG(("Start")); - - /* Check number of parameters */ - argc = silc_argument_get_arg_num(cmd->args); - if (argc < 1) { - silc_server_command_send_status_reply(cmd, SILC_COMMAND_JOIN, - SILC_STATUS_ERR_NOT_ENOUGH_PARAMS); - goto out; - } - if (argc > 3) { - silc_server_command_send_status_reply(cmd, SILC_COMMAND_JOIN, - SILC_STATUS_ERR_TOO_MANY_PARAMS); - goto out; - } + SILC_SERVER_COMMAND_CHECK_ARGC(SILC_COMMAND_JOIN, cmd, 1, 3); /* Get channel name */ tmp = silc_argument_get_arg_type(cmd->args, 1, &tmp_len); -- 2.43.0