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
fc843784
Commit
fc843784
authored
Mar 02, 2016
by
antirez
Browse files
BITFIELD: Farest bit set is offset+bits-1. Off by one error fixed.
parent
9a00da0d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/bitops.c
View file @
fc843784
...
...
@@ -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
...
...
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