Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
219e29af
Commit
219e29af
authored
Dec 05, 2017
by
zhaozhao.zz
Committed by
antirez
Dec 05, 2017
Browse files
set: fix the int problem for SPOP & SRANDMEMBER
parent
1980bcb7
Changes
1
Show whitespace changes
Inline
Side-by-side
src/t_set.c
View file @
219e29af
...
@@ -407,7 +407,7 @@ void spopWithCountCommand(client *c) {
...
@@ -407,7 +407,7 @@ void spopWithCountCommand(client *c) {
/* Get the count argument */
/* Get the count argument */
if
(
getLongFromObjectOrReply
(
c
,
c
->
argv
[
2
],
&
l
,
NULL
)
!=
C_OK
)
return
;
if
(
getLongFromObjectOrReply
(
c
,
c
->
argv
[
2
],
&
l
,
NULL
)
!=
C_OK
)
return
;
if
(
l
>=
0
)
{
if
(
l
>=
0
)
{
count
=
(
unsigned
)
l
;
count
=
(
unsigned
long
)
l
;
}
else
{
}
else
{
addReply
(
c
,
shared
.
outofrangeerr
);
addReply
(
c
,
shared
.
outofrangeerr
);
return
;
return
;
...
@@ -626,7 +626,7 @@ void srandmemberWithCountCommand(client *c) {
...
@@ -626,7 +626,7 @@ void srandmemberWithCountCommand(client *c) {
if
(
getLongFromObjectOrReply
(
c
,
c
->
argv
[
2
],
&
l
,
NULL
)
!=
C_OK
)
return
;
if
(
getLongFromObjectOrReply
(
c
,
c
->
argv
[
2
],
&
l
,
NULL
)
!=
C_OK
)
return
;
if
(
l
>=
0
)
{
if
(
l
>=
0
)
{
count
=
(
unsigned
)
l
;
count
=
(
unsigned
long
)
l
;
}
else
{
}
else
{
/* A negative count means: return the same elements multiple times
/* A negative count means: return the same elements multiple times
* (i.e. don't remove the extracted element after every extraction). */
* (i.e. don't remove the extracted element after every extraction). */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment