From 9ddd0f779686480e5ea462757e12e74b4fe4e2ac Mon Sep 17 00:00:00 2001 From: Gengliang Wang Date: Mon, 4 Feb 2013 14:01:08 +0800 Subject: [PATCH] Fix a bug in srandmemberWithCountCommand() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In CASE 2, the call sunionDiffGenericCommand will involve the string "srandmember" > sadd foo one (integer 1) > sadd srandmember two (integer 2) > srandmember foo 3 1)"one" 2)"two" --- src/t_set.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/t_set.c b/src/t_set.c index 3064807d..4db5372c 100644 --- a/src/t_set.c +++ b/src/t_set.c @@ -450,7 +450,7 @@ void srandmemberWithCountCommand(redisClient *c) { * The number of requested elements is greater than the number of * elements inside the set: simply return the whole set. */ if (count >= size) { - sunionDiffGenericCommand(c,c->argv,c->argc-1,NULL,REDIS_OP_UNION); + sunionDiffGenericCommand(c,c->argv+1,1,NULL,REDIS_OP_UNION); return; } -- GitLab