Skip to content

Commit 731b400

Browse files
lucaswerkmeistercgzones
authored andcommitted
Fix Security Attributes column header width
Limit the maximum width (instead of only the minimum width), pad the header width accordingly, and also remove extra stray spaces from the format string (the main spacing should just come from the alignment of the value). Fixes #850.
1 parent 30c5004 commit 731b400

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

linux/LinuxProcess.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = {
9393
[M_SWAP] = { .name = "M_SWAP", .title = " SWAP ", .description = "Size of the process's swapped pages", .flags = PROCESS_FLAG_LINUX_SMAPS, .defaultSortDesc = true, },
9494
[M_PSSWP] = { .name = "M_PSSWP", .title = " PSSWP ", .description = "shows proportional swap share of this mapping, unlike \"Swap\", this does not take into account swapped out page of underlying shmem objects", .flags = PROCESS_FLAG_LINUX_SMAPS, .defaultSortDesc = true, },
9595
[CTXT] = { .name = "CTXT", .title = " CTXT ", .description = "Context switches (incremental sum of voluntary_ctxt_switches and nonvoluntary_ctxt_switches)", .flags = PROCESS_FLAG_LINUX_CTXT, .defaultSortDesc = true, },
96-
[SECATTR] = { .name = "SECATTR", .title = " Security Attribute ", .description = "Security attribute of the process (e.g. SELinux or AppArmor)", .flags = PROCESS_FLAG_LINUX_SECATTR, },
96+
[SECATTR] = { .name = "SECATTR", .title = "Security Attribute ", .description = "Security attribute of the process (e.g. SELinux or AppArmor)", .flags = PROCESS_FLAG_LINUX_SECATTR, },
9797
[PROC_COMM] = { .name = "COMM", .title = "COMM ", .description = "comm string of the process from /proc/[pid]/comm", .flags = 0, },
9898
[PROC_EXE] = { .name = "EXE", .title = "EXE ", .description = "Basename of exe of the process from /proc/[pid]/exe", .flags = 0, },
9999
[CWD] = { .name = "CWD", .title = "CWD ", .description = "The current working directory of the process", .flags = PROCESS_FLAG_CWD, },
@@ -277,7 +277,7 @@ static void LinuxProcess_writeField(const Process* this, RichString* str, Proces
277277
}
278278
xSnprintf(buffer, n, "%5lu ", lp->ctxt_diff);
279279
break;
280-
case SECATTR: snprintf(buffer, n, "%-30s ", lp->secattr ? lp->secattr : "?"); break;
280+
case SECATTR: snprintf(buffer, n, "%-30.30s ", lp->secattr ? lp->secattr : "?"); break;
281281
case AUTOGROUP_ID:
282282
if (lp->autogroup_id != -1) {
283283
xSnprintf(buffer, n, "%4ld ", lp->autogroup_id);

0 commit comments

Comments
 (0)