Commit ddc7b85c authored by antirez's avatar antirez
Browse files

Geo: GEOENCODE: fix command arity check.

parent 6a8e108e
...@@ -600,11 +600,11 @@ void geoDecodeCommand(redisClient *c) { ...@@ -600,11 +600,11 @@ void geoDecodeCommand(redisClient *c) {
/* GEOENCODE long lat [radius unit] */ /* GEOENCODE long lat [radius unit] */
void geoEncodeCommand(redisClient *c) { void geoEncodeCommand(redisClient *c) {
double radius_meters = 0; double radius_meters = 0;
if (c->argc >= 5) { if (c->argc == 5) {
if ((radius_meters = extractDistanceOrReply(c, c->argv + 3, NULL)) < 0) if ((radius_meters = extractDistanceOrReply(c, c->argv + 3, NULL)) < 0)
return; return;
} else if (c->argc == 4) { } else if (c->argc == 4 || c->argc > 5) {
addReplyError(c, "must provide units when asking for radius encode"); addReplyError(c, "syntax error, try: GEOENCODE x y [radius unit]");
return; return;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment