summaryrefslogtreecommitdiffstats
path: root/Settings.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2020-11-21 21:40:08 +0100
committercgzones <cgzones@googlemail.com>2020-11-25 20:46:27 +0100
commit267014cbfe584ff9a1bc74d671f8aaa27251fd49 (patch)
treec49c5efc511a93722052084b78a735962db46b91 /Settings.c
parentadf918520976a5f06181c1c05392a0da6e4bbaa5 (diff)
Add support to change numeric options in settings screen
Like delay or highlightDelaySecs
Diffstat (limited to 'Settings.c')
-rw-r--r--Settings.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Settings.c b/Settings.c
index 9564c8ee..1daea7dc 100644
--- a/Settings.c
+++ b/Settings.c
@@ -160,7 +160,7 @@ static bool Settings_read(Settings* this, const char* fileName, int initialCpuCo
} else if (String_eq(option[0], "highlight_changes")) {
this->highlightChanges = atoi(option[1]);
} else if (String_eq(option[0], "highlight_changes_delay_secs")) {
- this->highlightDelaySecs = atoi(option[1]);
+ this->highlightDelaySecs = CLAMP(atoi(option[1]), 1, 24*60*60);
} else if (String_eq(option[0], "find_comm_in_cmdline")) {
this->findCommInCmdline = atoi(option[1]);
} else if (String_eq(option[0], "strip_exe_from_cmdline")) {
@@ -194,7 +194,7 @@ static bool Settings_read(Settings* this, const char* fileName, int initialCpuCo
} else if (String_eq(option[0], "account_guest_in_cpu_meter")) {
this->accountGuestInCPUMeter = atoi(option[1]);
} else if (String_eq(option[0], "delay")) {
- this->delay = atoi(option[1]);
+ this->delay = CLAMP(atoi(option[1]), 1, 255);
} else if (String_eq(option[0], "color_scheme")) {
this->colorScheme = atoi(option[1]);
if (this->colorScheme < 0 || this->colorScheme >= LAST_COLORSCHEME) {

© 2014-2024 Faster IT GmbH | imprint | privacy policy