Process: use correct column aligning on wide username

Closes: #421
This commit is contained in:
Christian Göttsche 2020-12-23 12:21:29 +01:00
parent 94d7f0b585
commit 5359eae28b
1 changed files with 6 additions and 7 deletions

View File

@ -363,15 +363,14 @@ void Process_writeField(const Process* this, RichString* str, ProcessField field
case USER: {
if (Process_getuid != this->st_uid)
attr = CRT_colors[PROCESS_SHADOW];
if (this->user) {
xSnprintf(buffer, n, "%-9s ", this->user);
} else {
xSnprintf(buffer, n, "%-9d ", this->st_uid);
}
if (buffer[9] != '\0') {
buffer[9] = ' ';
buffer[10] = '\0';
int c = RichString_appendnWide(str, attr, this->user, MINIMUM(9, strlen(this->user)));
RichString_appendChr(str, ' ', 10 - c);
return;
}
xSnprintf(buffer, n, "%-9d ", this->st_uid);
break;
}
default: