Wrong usage sdscatprintf in redis-cli. (#8604)
The result of `sdscatprintf` is doubled when using argument twice.
This commit is contained in:
parent
e7a97ad453
commit
947b86187e
@ -2953,8 +2953,12 @@ static int clusterManagerGetAntiAffinityScore(clusterManagerNodeArray *ipnodes,
|
|||||||
else types = sdsempty();
|
else types = sdsempty();
|
||||||
/* Master type 'm' is always set as the first character of the
|
/* Master type 'm' is always set as the first character of the
|
||||||
* types string. */
|
* types string. */
|
||||||
if (!node->replicate) types = sdscatprintf(types, "m%s", types);
|
if (node->replicate) types = sdscat(types, "s");
|
||||||
else types = sdscat(types, "s");
|
else {
|
||||||
|
sds s = sdscatsds(sdsnew("m"), types);
|
||||||
|
sdsfree(types);
|
||||||
|
types = s;
|
||||||
|
}
|
||||||
dictReplace(related, key, types);
|
dictReplace(related, key, types);
|
||||||
}
|
}
|
||||||
/* Now it's trivial to check, for each related group having the
|
/* Now it's trivial to check, for each related group having the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user