Commit c2e5be04 authored by antirez's avatar antirez
Browse files

RESP3: fix zrangeGenericCommand() proto dependent array len.

parent 8a0391fb
...@@ -2445,9 +2445,13 @@ void zrangeGenericCommand(client *c, int reverse) { ...@@ -2445,9 +2445,13 @@ void zrangeGenericCommand(client *c, int reverse) {
if (end >= llen) end = llen-1; if (end >= llen) end = llen-1;
rangelen = (end-start)+1; rangelen = (end-start)+1;
/* Return the result in form of a multi-bulk reply */ /* Return the result in form of a multi-bulk reply. RESP3 clients
if (withscores && c->resp == 2) rangelen *= 2; * will receive sub arrays with score->element, while RESP2 returned
addReplyArrayLen(c, rangelen); * a flat array. */
if (withscores && c->resp == 2)
addReplyArrayLen(c, rangelen*2);
else
addReplyArrayLen(c, rangelen);
if (zobj->encoding == OBJ_ENCODING_ZIPLIST) { if (zobj->encoding == OBJ_ENCODING_ZIPLIST) {
unsigned char *zl = zobj->ptr; unsigned char *zl = zobj->ptr;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment