]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - command.c
aft.c: Fix a nasty memory corruption bug in afs_ls on 64 bit archs.
[paraslash.git] / command.c
index 8bef14983546a86757022e9974ddd6342ee936b0..212a1800e1a32726096c3461c05ee2e9a3bacbfb 100644 (file)
--- a/command.c
+++ b/command.c
@@ -473,7 +473,7 @@ static struct server_command *get_cmd_ptr(const char *name, char **handler)
                if (!strcmp(cmd->name, name))
                        return cmd;
        /* not found, look for commands supported by afs */
-       for (cmd = afs_cmds; cmd; cmd++)
+       for (cmd = afs_cmds; cmd->name; cmd++)
                if (!strcmp(cmd->name, name))
                        return cmd;
        return NULL;
@@ -499,7 +499,7 @@ int com_help(int fd, int argc, char * const * argv)
                if (ret < 0)
                        return ret;
                cmd = afs_cmds;
-               ret = send_list_of_commands(fd, cmd, "afs");
+               return send_list_of_commands(fd, cmd, "afs");
        }
        /* argument given for help */
        cmd = get_cmd_ptr(argv[1], &handler);