summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2015-06-29 09:39:34 +0200
committerantirez <antirez@gmail.com>2015-06-29 09:39:34 +0200
commitddc7b85c5f28fd96009a006e5bed5c775bc7f367 (patch)
tree8a41440e201ad3a29e2b2e1f5ed11627717111d4
parent6a8e108e2d220e95668a14db4bc891bfe1bb9743 (diff)
downloadredis-ddc7b85c5f28fd96009a006e5bed5c775bc7f367.tar.gz
Geo: GEOENCODE: fix command arity check.
-rw-r--r--src/geo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/geo.c b/src/geo.c
index c2e963f60..37d632815 100644
--- a/src/geo.c
+++ b/src/geo.c
@@ -600,11 +600,11 @@ void geoDecodeCommand(redisClient *c) {
/* GEOENCODE long lat [radius unit] */
void geoEncodeCommand(redisClient *c) {
double radius_meters = 0;
- if (c->argc >= 5) {
+ if (c->argc == 5) {
if ((radius_meters = extractDistanceOrReply(c, c->argv + 3, NULL)) < 0)
return;
- } else if (c->argc == 4) {
- addReplyError(c, "must provide units when asking for radius encode");
+ } else if (c->argc == 4 || c->argc > 5) {
+ addReplyError(c, "syntax error, try: GEOENCODE x y [radius unit]");
return;
}