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
001cadc8
Commit
001cadc8
authored
Jun 15, 2016
by
Salvatore Sanfilippo
Committed by
GitHub
Jun 15, 2016
Browse files
Merge pull request #3282 from wenduo/unstable
bitcount bug:return non-zero value when start > end (both negative)
parents
3deb7bad
41dacdbc
Changes
1
Show whitespace changes
Inline
Side-by-side
src/bitops.c
View file @
001cadc8
...
...
@@ -775,6 +775,10 @@ void bitcountCommand(client *c) {
/* Convert negative indexes */
if (start < 0) start = strlen+start;
if (end < 0) end = strlen+end;
if ((start < 0) && (end < 0) && (start > end)) {
addReply(c,shared.czero);
return;
}
if (start < 0) start = 0;
if (end < 0) end = 0;
if (end >= strlen) end = strlen-1;
...
...
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