]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb:tool: Remove unnecessary strlen()
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Mon, 3 Apr 2023 23:34:47 +0000 (11:34 +1200)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 12 Apr 2023 13:52:31 +0000 (13:52 +0000)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
ctdb/tools/ctdb.c

index 35e43ee72917d725b92cd0b6725943007c6e7f20..67d2f6bc1c98fd5170b83044a909759ef3f6fe3d 100644 (file)
@@ -6168,8 +6168,7 @@ static const struct ctdb_cmd *match_command(const char *command)
 
        for (i=0; i<ARRAY_SIZE(ctdb_commands); i++) {
                cmd = &ctdb_commands[i];
-               if (strlen(command) == strlen(cmd->name) &&
-                   strncmp(command, cmd->name, strlen(command)) == 0) {
+               if (strcmp(command, cmd->name) == 0) {
                        return cmd;
                }
        }