mirror of https://github.com/xzeldon/htop.git
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.
This commit is contained in:
parent
5bc988ad6d
commit
6fcb1994c8
|
@ -242,8 +242,10 @@ static void ScreenSettings_readFields(ScreenSettings* ss, Hashtable* columns, co
|
||||||
char** ids = String_split(trim, ' ', NULL);
|
char** ids = String_split(trim, ' ', NULL);
|
||||||
free(trim);
|
free(trim);
|
||||||
|
|
||||||
unsigned int i, j;
|
/* reset default fields */
|
||||||
for (j = 0, i = 0; ids[i]; i++) {
|
memset(ss->fields, '\0', LAST_PROCESSFIELD * sizeof(ProcessField));
|
||||||
|
|
||||||
|
for (size_t j = 0, i = 0; ids[i]; i++) {
|
||||||
if (j >= UINT_MAX / sizeof(ProcessField))
|
if (j >= UINT_MAX / sizeof(ProcessField))
|
||||||
continue;
|
continue;
|
||||||
if (j >= LAST_PROCESSFIELD) {
|
if (j >= LAST_PROCESSFIELD) {
|
||||||
|
|
Loading…
Reference in New Issue