summaryrefslogtreecommitdiff
path: root/src/geo.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2015-10-06 09:25:28 +0200
committerantirez <antirez@gmail.com>2015-10-06 09:25:28 +0200
commit319d18013646bb9c14d0c070a566d058558bf762 (patch)
treea667c39d6c841f12d0d38859fc5048e2bbc179f8 /src/geo.c
parent19f6ab50c39cbfb497bd8ee3003375c1327a5266 (diff)
downloadredis-319d18013646bb9c14d0c070a566d058558bf762.tar.gz
Fix GEORADIUS COUNT option arity checks.
Diffstat (limited to 'src/geo.c')
-rw-r--r--src/geo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/geo.c b/src/geo.c
index d0381ce5e..daff0dd9e 100644
--- a/src/geo.c
+++ b/src/geo.c
@@ -481,7 +481,7 @@ void georadiusGeneric(client *c, int type) {
sort = SORT_ASC;
} else if (!strcasecmp(arg, "desc")) {
sort = SORT_DESC;
- } else if (!strcasecmp(arg, "count") && remaining > 0) {
+ } else if (!strcasecmp(arg, "count") && (i+1) < remaining) {
if (getLongLongFromObjectOrReply(c, c->argv[base_args+i+1],
&count, NULL) != C_OK) return;
if (count <= 0) {