From 79c1dd44ca4c4940e0ddeafb2d98e409ca3c729a Mon Sep 17 00:00:00 2001 From: Tigran Aivazian Date: Sun, 30 Sep 2012 16:06:55 +0100 Subject: [PATCH] Restrict the values of rcountmax to the range 0-10 Currently the user can enter any value like -10 and it is accepted and saved in the settings file(s). --- unireader.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unireader.lua b/unireader.lua index 20e740b26..c942b70d3 100644 --- a/unireader.lua +++ b/unireader.lua @@ -2490,7 +2490,7 @@ function UniReader:addAllCommands() if pcall(function () count = count + 0 end) then -- restrict self.rcountmax in reasonable range self.rcountmax = math.max(count, 0) - self.rcountmax = math.min(count, 10) + self.rcountmax = math.min(self.rcountmax, 10) -- storing this parameter in both global and local settings G_reader_settings:saveSetting("rcountmax", self.rcountmax) self.settings:saveSetting("rcountmax", self.rcountmax)