diff options
-rw-r--r-- | dalos-limiter.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/dalos-limiter.lua b/dalos-limiter.lua index b8387e3..5badfbb 100644 --- a/dalos-limiter.lua +++ b/dalos-limiter.lua @@ -19,7 +19,7 @@ Limit: %i{The actual size this limiter is going to produce} self.color = cd.GREEN local obj = { h = h, - size = math.max(h:getsize(), self.limit), + size = math.min(h:getsize(), self.extra.limit), getname = function () return self.name end, do_read = function (self, count, userdata) return self.h:read(count, userdata) @@ -47,7 +47,8 @@ Limit: %i{The actual size this limiter is going to produce} tab.ntype = "Limiter" tab.get_settings = dalosp.limiter.get_settings local extra = { } - if settings then extra.limit = settings.limit end + if not settings then settings = {} end + extra.limit = settings.limit or 0 local obj = dalos.object(d, tab, extra) |