mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-24 15:15:44 +00:00
Update Settings_newScreen with single-line sortKey checking.
Co-authored-by: BenBE <BenBE@geshi.org>
This commit is contained in:
parent
cde72dd0b0
commit
10b541b5e4
@ -271,11 +271,7 @@ static void ScreenSettings_readFields(ScreenSettings* ss, Hashtable* columns, co
|
||||
|
||||
ScreenSettings* Settings_newScreen(Settings* this, const ScreenDefaults* defaults) {
|
||||
int sortKey = defaults->sortKey ? toFieldIndex(this->dynamicColumns, defaults->sortKey) : PID;
|
||||
int sortDesc;
|
||||
if (sortKey >= 0 && sortKey < LAST_PROCESSFIELD)
|
||||
sortDesc = Process_fields[sortKey].defaultSortDesc;
|
||||
else
|
||||
sortDesc = 1;
|
||||
int sortDesc = (sortKey >= 0 && sortKey < LAST_PROCESSFIELD) ? Process_fields[sortKey].defaultSortDesc : 1;
|
||||
|
||||
ScreenSettings* ss = xMalloc(sizeof(ScreenSettings));
|
||||
*ss = (ScreenSettings) {
|
||||
|
Loading…
Reference in New Issue
Block a user