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
7ba2cf5f
You need to sign in or sign up before continuing.
Commit
7ba2cf5f
authored
May 04, 2016
by
antirez
Browse files
Reply with error on negative geo radius.
Thanks to @tidwall for reporting. Close #3194.
parent
38cf2bd2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/geo.c
View file @
7ba2cf5f
...
@@ -157,7 +157,10 @@ double extractDistanceOrReply(client *c, robj **argv,
...
@@ -157,7 +157,10 @@ double extractDistanceOrReply(client *c, robj **argv,
}
}
double
to_meters
=
extractUnitOrReply
(
c
,
argv
[
1
]);
double
to_meters
=
extractUnitOrReply
(
c
,
argv
[
1
]);
if
(
to_meters
<
0
)
return
-
1
;
if
(
to_meters
<
0
)
{
addReplyError
(
c
,
"radius cannot be negative"
);
return
-
1
;
}
if
(
conversion
)
*
conversion
=
to_meters
;
if
(
conversion
)
*
conversion
=
to_meters
;
return
distance
*
to_meters
;
return
distance
*
to_meters
;
...
...
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