From 5359eae28b38809f1977a901740ecaab8f7ade6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Wed, 23 Dec 2020 12:21:29 +0100 Subject: [PATCH] Process: use correct column aligning on wide username Closes: #421 --- Process.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Process.c b/Process.c index fc105cbe..8dfd504c 100644 --- a/Process.c +++ b/Process.c @@ -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: