mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
Reply with error on negative geo radius.
Thanks to @tidwall for reporting. Close #3194.
This commit is contained in:
parent
9c48f28e54
commit
2c22f59c3f
@ -157,7 +157,10 @@ double extractDistanceOrReply(client *c, robj **argv,
|
||||
}
|
||||
|
||||
double to_meters = extractUnitOrReply(c,argv[1]);
|
||||
if (to_meters < 0) return -1;
|
||||
if (to_meters < 0) {
|
||||
addReplyError(c,"radius cannot be negative");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (conversion) *conversion = to_meters;
|
||||
return distance * to_meters;
|
||||
|
Loading…
Reference in New Issue
Block a user