diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2018-08-24 16:23:20 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-08-24 18:39:00 -0300 |
commit | 0939e5cb4139a873f4338a4a9d497e6b38181ca4 (patch) | |
tree | a86654dfb4d24ba92ab4321ea055c55f6458c949 /Settings.c | |
parent | e1c2dc56fd2e4c9bd58d1ede0fd0a8698f091e67 (diff) |
Settings: fix default and storage of sort keys
Diffstat (limited to 'Settings.c')
-rw-r--r-- | Settings.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -216,6 +216,9 @@ static void Settings_defaultMeters(Settings* this) { } static const char* toFieldName(int i) { + if (i < 0 || i > LAST_PROCESSFIELD) { + return ""; + } return Process_fields[i].name; } @@ -275,7 +278,7 @@ static void Settings_defaultScreens(Settings* this) { for (unsigned int i = 0; i < Platform_numberOfDefaultScreens; i++) { ScreenDefaults* defaults = &Platform_defaultScreens[i]; Settings_newScreen(this, defaults->name, defaults->columns); - this->screens[0]->sortKey = toFieldIndex(defaults->sortKey); + this->screens[i]->sortKey = toFieldIndex(defaults->sortKey); } } |