diff options
author | Gengliang Wang <ltnwgl@gmail.com> | 2013-02-04 14:01:08 +0800 |
---|---|---|
committer | Gengliang Wang <ltnwgl@gmail.com> | 2013-02-04 14:01:08 +0800 |
commit | 002747336a37b72b84503848a3f7f4f8cbc414cf (patch) | |
tree | ab6ef47f8eb5ab4a97078bb0e118bef59a4241dc /src/t_set.c | |
parent | 089cbe643f3922aec26d483548e14c8d10f74e0c (diff) | |
download | redis-002747336a37b72b84503848a3f7f4f8cbc414cf.tar.gz |
Fix a bug in srandmemberWithCountCommand()
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"
Diffstat (limited to 'src/t_set.c')
-rw-r--r-- | src/t_set.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/t_set.c b/src/t_set.c index e56a5fd4e..9d4bab670 100644 --- a/src/t_set.c +++ b/src/t_set.c @@ -469,7 +469,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; } |