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
78df0165
Commit
78df0165
authored
Apr 02, 2020
by
Xudong Zhang
Browse files
fix integer overflow
parent
416d394c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/quicklist.c
View file @
78df0165
...
...
@@ -110,7 +110,7 @@ quicklist *quicklistCreate(void) {
return
quicklist
;
}
#define COMPRESS_MAX (1 << QL_COMP_BITS)
#define COMPRESS_MAX
(
(1 << QL_COMP_BITS)
-1)
void
quicklistSetCompressDepth
(
quicklist
*
quicklist
,
int
compress
)
{
if
(
compress
>
COMPRESS_MAX
)
{
compress
=
COMPRESS_MAX
;
...
...
@@ -120,7 +120,7 @@ void quicklistSetCompressDepth(quicklist *quicklist, int compress) {
quicklist
->
compress
=
compress
;
}
#define FILL_MAX (1 << (QL_FILL_BITS-1))
#define FILL_MAX
(
(1 << (QL_FILL_BITS-1))
-1)
void
quicklistSetFill
(
quicklist
*
quicklist
,
int
fill
)
{
if
(
fill
>
FILL_MAX
)
{
fill
=
FILL_MAX
;
...
...
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