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
0b537972
Commit
0b537972
authored
Mar 04, 2011
by
antirez
Browse files
Fixed return value of GETRANGE / SUBSTR
parent
4aec2ec8
Changes
1
Show whitespace changes
Inline
Side-by-side
src/t_string.c
View file @
0b537972
...
...
@@ -259,7 +259,7 @@ void getrangeCommand(redisClient *c) {
return
;
if
(
getLongFromObjectOrReply
(
c
,
c
->
argv
[
3
],
&
end
,
NULL
)
!=
REDIS_OK
)
return
;
if
((
o
=
lookupKeyReadOrReply
(
c
,
c
->
argv
[
1
],
shared
.
null
bulk
))
==
NULL
||
if
((
o
=
lookupKeyReadOrReply
(
c
,
c
->
argv
[
1
],
shared
.
empty
bulk
))
==
NULL
||
checkType
(
c
,
o
,
REDIS_STRING
))
return
;
if
(
o
->
encoding
==
REDIS_ENCODING_INT
)
{
...
...
@@ -280,7 +280,7 @@ void getrangeCommand(redisClient *c) {
/* Precondition: end >= 0 && end < strlen, so the only condition where
* nothing can be returned is: start > end. */
if
(
start
>
end
)
{
addReply
(
c
,
shared
.
null
bulk
);
addReply
(
c
,
shared
.
empty
bulk
);
}
else
{
addReplyBulkCBuffer
(
c
,(
char
*
)
str
+
start
,
end
-
start
+
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