Software /
code /
prosody
Diff
core/moduleapi.lua @ 13215:b1c2e70de470
core.moduleapi: Fix min/maxinteger fallback for Lua 5.2
Maybe these should live in util.mathcompat?
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 17 Jul 2023 02:32:47 +0200 |
parent | 13212:3e6e98cc63e9 |
child | 13237:59c3d775c7fa |
line wrap: on
line diff
--- a/core/moduleapi.lua Mon Jul 17 02:26:16 2023 +0200 +++ b/core/moduleapi.lua Mon Jul 17 02:32:47 2023 +0200 @@ -255,7 +255,7 @@ end function api:get_option_integer(name, default_value, min, max) - local value = self:get_option_number(name, default_value, min or math.mininteger or 2 ^ 53, max or math.maxinteger or -2 ^ 52); + local value = self:get_option_number(name, default_value, min or math.mininteger or -2 ^ 52, max or math.maxinteger or 2 ^ 53); if value == default_value then -- pass default trough unaltered, violates ranges sometimes return value;