summaryrefslogtreecommitdiff
path: root/src/cluster.c
diff options
context:
space:
mode:
authorSalvatore Sanfilippo <antirez@gmail.com>2017-07-24 14:18:28 +0200
committerGitHub <noreply@github.com>2017-07-24 14:18:28 +0200
commitd9565379da0adf97caec12e9b88c17da51900e40 (patch)
tree36124d69f7ffb6f83ac4a4789b473bc0512e6d71 /src/cluster.c
parent7c3c472b5e5861787055c74b189e6a8b590e9e81 (diff)
parent9e7a8c0207bab8045dc2938a21657d711a9c4953 (diff)
downloadredis-d9565379da0adf97caec12e9b88c17da51900e40.tar.gz
Merge pull request #4128 from leonchen83/unstable
fix mismatch argument and return wrong value of clusterDelNodeSlots
Diffstat (limited to 'src/cluster.c')
-rw-r--r--src/cluster.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/cluster.c b/src/cluster.c
index 89765e37d..a9fedce0c 100644
--- a/src/cluster.c
+++ b/src/cluster.c
@@ -3602,8 +3602,10 @@ int clusterDelNodeSlots(clusterNode *node) {
int deleted = 0, j;
for (j = 0; j < CLUSTER_SLOTS; j++) {
- if (clusterNodeGetSlotBit(node,j)) clusterDelSlot(j);
- deleted++;
+ if (clusterNodeGetSlotBit(node,j)) {
+ clusterDelSlot(j);
+ deleted++;
+ }
}
return deleted;
}
@@ -4195,7 +4197,7 @@ void clusterCommand(client *c) {
}
if ((n = clusterLookupNode(c->argv[4]->ptr)) == NULL) {
addReplyErrorFormat(c,"I don't know about node %s",
- (char*)c->argv[3]->ptr);
+ (char*)c->argv[4]->ptr);
return;
}
server.cluster->importing_slots_from[slot] = n;