summaryrefslogtreecommitdiffstats
path: root/Settings.c
diff options
context:
space:
mode:
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) {