summaryrefslogtreecommitdiffstats
path: root/Settings.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2021-12-16 15:49:17 +0100
committercgzones <cgzones@googlemail.com>2021-12-17 14:45:15 +0100
commit6fcb1994c88cc33677c04352ddd8d6448c22c908 (patch)
tree624a6e2b3c6ccb43f8eab13e5b82770d03efd44f /Settings.c
parent5bc988ad6de7d0767c639fb150e68be78c00b1fa (diff)
Do not combine default and configuration process fields
When reading a configuration file with the syntax previous to the screens update Settings_defaultScreens() will add the default fields and later ScreenSettings_readFields() will add the ones from the configuration file. This will duplicate some fields and corrupt the columns due to the boundless Command field.
Diffstat (limited to 'Settings.c')
-rw-r--r--Settings.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Settings.c b/Settings.c
index 278f0382..ee2fe1b5 100644
--- a/Settings.c
+++ b/Settings.c
@@ -242,8 +242,10 @@ static void ScreenSettings_readFields(ScreenSettings* ss, Hashtable* columns, co
char** ids = String_split(trim, ' ', NULL);
free(trim);
- unsigned int i, j;
- for (j = 0, i = 0; ids[i]; i++) {
+ /* reset default fields */
+ memset(ss->fields, '\0', LAST_PROCESSFIELD * sizeof(ProcessField));
+
+ for (size_t j = 0, i = 0; ids[i]; i++) {
if (j >= UINT_MAX / sizeof(ProcessField))
continue;
if (j >= LAST_PROCESSFIELD) {

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