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
de83c8a0
Commit
de83c8a0
authored
Mar 28, 2023
by
Vitaly Arbuzov
Browse files
Use long long version of strto when parsing cursor
parent
1cf48a34
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/db.c
View file @
de83c8a0
...
@@ -960,10 +960,10 @@ void scanCallback(void *privdata, const dictEntry *de) {
...
@@ -960,10 +960,10 @@ void scanCallback(void *privdata, const dictEntry *de) {
int
parseScanCursorOrReply
(
client
*
c
,
robj
*
o
,
unsigned
long
long
*
cursor
)
{
int
parseScanCursorOrReply
(
client
*
c
,
robj
*
o
,
unsigned
long
long
*
cursor
)
{
char
*
eptr
;
char
*
eptr
;
/* Use strtou
l
() because we need an *unsigned* long, so
/* Use strtou
q
() because we need an *unsigned*
long
long, so
* getLongLongFromObject() does not cover the whole cursor space. */
* getLongLongFromObject() does not cover the whole cursor space. */
errno
=
0
;
errno
=
0
;
*
cursor
=
strtou
l
(
o
->
ptr
,
&
eptr
,
10
);
*
cursor
=
strtou
q
(
o
->
ptr
,
&
eptr
,
10
);
if
(
isspace
(((
char
*
)
o
->
ptr
)[
0
])
||
eptr
[
0
]
!=
'\0'
||
errno
==
ERANGE
)
if
(
isspace
(((
char
*
)
o
->
ptr
)[
0
])
||
eptr
[
0
]
!=
'\0'
||
errno
==
ERANGE
)
{
{
addReplyError
(
c
,
"invalid cursor"
);
addReplyError
(
c
,
"invalid cursor"
);
...
...
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