Commit fc843784 authored by antirez's avatar antirez
Browse files

BITFIELD: Farest bit set is offset+bits-1. Off by one error fixed.

parent 9a00da0d
......@@ -964,8 +964,10 @@ void bitfieldCommand(client *c) {
* for simplicity. SET return value is the previous value so
* we need fetch & store as well. */
if ((o = lookupStringForBitCommand(c,thisop->offset + thisop->bits))
== NULL) return;
/* Lookup by making room up to the farest bit reached by
* this operation. */
if ((o = lookupStringForBitCommand(c,
thisop->offset + (thisop->bits-1))) == NULL) return;
/* We need two different but very similar code paths for signed
* and unsigned operations, since the set of functions to get/set
......
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