command.c: simplify send_description()
authorAndre <maan@p133.(none)>
Thu, 4 Jan 2007 15:46:03 +0000 (16:46 +0100)
committerAndre <maan@p133.(none)>
Thu, 4 Jan 2007 15:46:03 +0000 (16:46 +0100)
Last argument was 0 for both callers. Kill this arg.

command.c

index f096edcc37493bab7dbe8e4cab461da71dee50ce..321883ca58ad2e339c5a0a981c42c70e4de3ea2f 100644 (file)
--- a/command.c
+++ b/command.c
@@ -699,11 +699,11 @@ out:
        return ret;
 }
 
-static int send_description(int fd, struct server_command *cmd, const char *handler, int num)
+static int send_description(int fd, struct server_command *cmd, const char *handler)
 {
        int ret, i;
 
-       for (i = 1; cmd->name && (!num || i <= num); cmd++, i++) {
+       for (i = 1; cmd->name; cmd++, i++) {
                char *perms = cmd_perms_itohuman(cmd->perms);
                ret = send_va_buffer(fd, "%s\t%s\t%s\t%s\n", cmd->name,
                        handler,
@@ -749,13 +749,13 @@ static int com_help(int fd, int argc, char **argv)
 
        if (argc < 2) {
                /* no argument given, print list of commands */
-               if ((ret = send_description(fd, cmd_struct, "server", 0)) < 0)
+               if ((ret = send_description(fd, cmd_struct, "server")) < 0)
                        return ret;
                mmd_lock();
                handler = para_strdup(selectors[mmd->selector_num].name);
                cmd = selectors[mmd->selector_num].cmd_list;
                mmd_unlock();
-               ret = send_description(fd, cmd, handler, 0);
+               ret = send_description(fd, cmd, handler);
                free(handler);
                return ret;
        }