summaryrefslogtreecommitdiff
path: root/src/geo.c
diff options
context:
space:
mode:
authororanagra <oran@redislabs.com>2016-05-23 13:58:50 +0300
committeroranagra <oran@redislabs.com>2016-05-23 13:58:50 +0300
commitf3e81de17688e310b7a5ef5108a3a6c8962eb133 (patch)
treec6f54c9e9faab72908a819e1a0a113de29be2b20 /src/geo.c
parentb09a6b6a5d7c7c2de81325b3c1ab687536059009 (diff)
downloadredis-f3e81de17688e310b7a5ef5108a3a6c8962eb133.tar.gz
fix georadius returns multiple replies
Diffstat (limited to 'src/geo.c')
-rw-r--r--src/geo.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/geo.c b/src/geo.c
index bcedd4637..28cb433dc 100644
--- a/src/geo.c
+++ b/src/geo.c
@@ -156,9 +156,13 @@ double extractDistanceOrReply(client *c, robj **argv,
return -1;
}
+ if (distance < 0) {
+ addReplyError(c,"radius cannot be negative");
+ return -1;
+ }
+
double to_meters = extractUnitOrReply(c,argv[1]);
if (to_meters < 0) {
- addReplyError(c,"radius cannot be negative");
return -1;
}
@@ -465,7 +469,6 @@ void georadiusGeneric(client *c, int type) {
double radius_meters = 0, conversion = 1;
if ((radius_meters = extractDistanceOrReply(c, c->argv + base_args - 2,
&conversion)) < 0) {
- addReplyError(c,"radius must be >= 0");
return;
}