diff options
author | zhaozhao.zz <zhaozhao.zz@alibaba-inc.com> | 2017-12-05 17:19:19 +0800 |
---|---|---|
committer | zhaozhao.zz <zhaozhao.zz@alibaba-inc.com> | 2017-12-05 17:19:19 +0800 |
commit | de809666f81675bb21ca09049ea67cf1d32ff9b7 (patch) | |
tree | 504c8fc781119bbe4705f46bae855eedb0205532 | |
parent | e6c3bcf9e072c8c40814577f2421b5d5184b2243 (diff) | |
download | redis-de809666f81675bb21ca09049ea67cf1d32ff9b7.tar.gz |
set: fix the int problem for SPOP & SRANDMEMBER
-rw-r--r-- | src/t_set.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/t_set.c b/src/t_set.c index d5a801e11..36299317d 100644 --- a/src/t_set.c +++ b/src/t_set.c @@ -407,7 +407,7 @@ void spopWithCountCommand(client *c) { /* Get the count argument */ if (getLongFromObjectOrReply(c,c->argv[2],&l,NULL) != C_OK) return; if (l >= 0) { - count = (unsigned) l; + count = (unsigned long) l; } else { addReply(c,shared.outofrangeerr); return; @@ -626,7 +626,7 @@ void srandmemberWithCountCommand(client *c) { if (getLongFromObjectOrReply(c,c->argv[2],&l,NULL) != C_OK) return; if (l >= 0) { - count = (unsigned) l; + count = (unsigned long) l; } else { /* A negative count means: return the same elements multiple times * (i.e. don't remove the extracted element after every extraction). */ |