diff --git a/src/redis-cli.c b/src/redis-cli.c index 0ab6a017f..b2f7ace0e 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -6613,9 +6613,9 @@ static int clusterManagerCommandImport(int argc, char **argv) { } if (config.cluster_manager_command.flags & CLUSTER_MANAGER_CMD_FLAG_COPY) - strcat(cmdfmt, " %s"); + cmdfmt = sdscat(cmdfmt," COPY"); if (config.cluster_manager_command.flags & CLUSTER_MANAGER_CMD_FLAG_REPLACE) - strcat(cmdfmt, " %s"); + cmdfmt = sdscat(cmdfmt," REPLACE"); /* Use SCAN to iterate over the keys, migrating to the * right node as needed. */ @@ -6647,8 +6647,7 @@ static int clusterManagerCommandImport(int argc, char **argv) { printf("Migrating %s to %s:%d: ", key, target->ip, target->port); redisReply *r = reconnectingRedisCommand(src_ctx, cmdfmt, target->ip, target->port, - key, 0, timeout, - "COPY", "REPLACE"); + key, 0, timeout); if (!r || r->type == REDIS_REPLY_ERROR) { if (r && r->str) { clusterManagerLogErr("Source %s:%d replied with "