Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
c2e5be04
Commit
c2e5be04
authored
Dec 03, 2018
by
antirez
Browse files
RESP3: fix zrangeGenericCommand() proto dependent array len.
parent
8a0391fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/t_zset.c
View file @
c2e5be04
...
...
@@ -2445,9 +2445,13 @@ void zrangeGenericCommand(client *c, int reverse) {
if
(
end
>=
llen
)
end
=
llen
-
1
;
rangelen
=
(
end
-
start
)
+
1
;
/* Return the result in form of a multi-bulk reply */
if
(
withscores
&&
c
->
resp
==
2
)
rangelen
*=
2
;
addReplyArrayLen
(
c
,
rangelen
);
/* Return the result in form of a multi-bulk reply. RESP3 clients
* will receive sub arrays with score->element, while RESP2 returned
* a flat array. */
if
(
withscores
&&
c
->
resp
==
2
)
addReplyArrayLen
(
c
,
rangelen
*
2
);
else
addReplyArrayLen
(
c
,
rangelen
);
if
(
zobj
->
encoding
==
OBJ_ENCODING_ZIPLIST
)
{
unsigned
char
*
zl
=
zobj
->
ptr
;
...
...
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