diff options
author | antirez <antirez@gmail.com> | 2020-04-15 16:01:56 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2020-04-15 16:01:56 +0200 |
commit | e8dd99fa532d931a980915c8a1abe173f640210c (patch) | |
tree | 6493cc33dfac4f2e7afe8f5398022a1cc73226e2 | |
parent | 7f794a122f0bd5f0babf504a80484a533742e8e9 (diff) | |
parent | dfd3ead90ddaf188a3a922acb100807d4d1b29ff (diff) | |
download | redis-e8dd99fa532d931a980915c8a1abe173f640210c.tar.gz |
Merge branch 'unstable' of github.com:/antirez/redis into unstable
-rw-r--r-- | src/geohash.c | 4 | ||||
-rw-r--r-- | src/timeout.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/geohash.c b/src/geohash.c index db5ae025a..de9620b7a 100644 --- a/src/geohash.c +++ b/src/geohash.c @@ -206,7 +206,11 @@ int geohashDecodeWGS84(const GeoHashBits hash, GeoHashArea *area) { int geohashDecodeAreaToLongLat(const GeoHashArea *area, double *xy) { if (!xy) return 0; xy[0] = (area->longitude.min + area->longitude.max) / 2; + if (xy[0] > GEO_LONG_MAX) xy[0] = GEO_LONG_MAX; + if (xy[0] < GEO_LONG_MIN) xy[0] = GEO_LONG_MIN; xy[1] = (area->latitude.min + area->latitude.max) / 2; + if (xy[1] > GEO_LAT_MAX) xy[1] = GEO_LAT_MAX; + if (xy[1] < GEO_LAT_MIN) xy[1] = GEO_LAT_MIN; return 1; } diff --git a/src/timeout.c b/src/timeout.c index bb5999418..7787a049f 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -166,7 +166,7 @@ int getTimeoutFromObjectOrReply(client *c, robj *object, mstime_t *timeout, int if (unit == UNIT_SECONDS) { if (getLongDoubleFromObjectOrReply(c,object,&ftval, - "timeout is not an float or out of range") != C_OK) + "timeout is not a float or out of range") != C_OK) return C_ERR; tval = (long long) (ftval * 1000.0); } else { |