diff options
Diffstat (limited to 'src/geo.c')
-rw-r--r-- | src/geo.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -466,7 +466,7 @@ void georadiusGeneric(client *c, int flags) { /* Look up the requested zset */ robj *zobj = NULL; - if ((zobj = lookupKeyReadOrReply(c, key, shared.null[c->resp])) == NULL || + if ((zobj = lookupKeyReadOrReply(c, key, shared.emptyarray)) == NULL || checkType(c, zobj, OBJ_ZSET)) { return; } @@ -566,7 +566,7 @@ void georadiusGeneric(client *c, int flags) { /* If no matching results, the user gets an empty reply. */ if (ga->used == 0 && storekey == NULL) { - addReplyNull(c); + addReply(c,shared.emptyarray); geoArrayFree(ga); return; } @@ -734,14 +734,14 @@ void geohashCommand(client *c) { r[1].max = 90; geohashEncode(&r[0],&r[1],xy[0],xy[1],26,&hash); - char buf[12]; + char buf[11]; int i; - for (i = 0; i < 11; i++) { + for (i = 0; i < 10; i++) { int idx = (hash.bits >> (52-((i+1)*5))) & 0x1f; buf[i] = geoalphabet[idx]; } - buf[11] = '\0'; - addReplyBulkCBuffer(c,buf,11); + buf[10] = '\0'; + addReplyBulkCBuffer(c,buf,10); } } } |