mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 17:10:50 +00:00
set: fix the int problem for SPOP & SRANDMEMBER
This commit is contained in:
parent
e6c3bcf9e0
commit
de809666f8
@ -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). */
|
||||
|
Loading…
x
Reference in New Issue
Block a user